There were a few things wrong with the code, which I'll explain below.
The first problem was in both Circle.java and CircleDemo.java. In Circle.java, you never provided a way to initialize the private variable Radius, so it was always defaulting to 0.0 after making a new Circle(). To fix this, I've made Circle() require a radius parameter on initialization, which is a double. In the public method Circle, it sets its own instance of Radius to the parameter given at initialization.
In CircleDemo.java, the modification to that was to initialize a new Circle() after getting the user's input and setting it to Radius. The Radius variable is then passed as an argument to Circle() during initialization, to set that instance up properly.
The second issue is simpler, and was a typo when you defined CircleDemo.java's class, you put public class Cir
lceDemo;
Fixed code for Circle.java:
public class Circle
{
private double Radius;
private final double Pi = 3.14159;
public Circle(double r)
{
this.Radius = r;
}
public double getRadius()
{
return Radius;
}
public double getArea()
{
return Pi * Radius * Radius;
}
public double getDiameter()
{
return Radius * 2;
}
public double getCircumference()
{
return Pi * 2 * Radius;
}
}
Fixed code for CircleDemo.java:
import java.util.Scanner;
public class CircleDemo
{
public static void main(String[] args)
{
double Radius;
double Pi;
double Area;
double Diameter;
double Circumference;
Scanner keyboard = new Scanner(System.in);
System.out.print("What is the radius of the circle? ");
Radius = keyboard.nextDouble();
Circle r = new Circle(Radius);
System.out.println("The area of the circle is " + r.getArea());
System.out.println("The diameter of the circle is " + r.getDiameter());
System.out.println("The circumference of the circle is " + r.getCircumference());
}
}
EDIT: For full disclosure, I'm not a Java developer, the code above appears to compile and function on my computer with limited testing, so if it's actually incorrect, that's why
Also, if you haven't learned the "this" keyword in your class yet, then uhh... You
should be able to remove that "this." part and just modify Radius as-is, but it's typically frowned upon to do that since in any of the object-oriented languages I've used, not specifying it can cause headaches later on, on more complex programs. But... Don't use that keyword if you haven't been taught it yet, unless you're allowed to get outside help on that project