public class circle
{
double circle1;
double Xvalue;
double Yvalue;
double radius;
public double area = (3.14*(this.radius * this.radius));
public double getArea ()
{
return area;
}
}
//这是我将创建对象的第二个类
public class tester
{
public static void main(String args [])
{
circle circle1 = new circle();
circle1.Xvalue = 1;
circle1.Yvalue = 2;
circle1.radius = 4;
System.out.println(getArea());
//im not too sure why the print statement won't print the method getArea.
}
}