package myJava1;
public class circletest
{
public static void main(String[] args)
{
circle r;
r=new circle();
System.out.println("圆的半径是:"+r.radious);
double result=r.area();
System.out.println("圆的面积是:"+result);
}
}
class circle
{
int radious=10;
double area()
{
double PI=3.14;
return PI*radious*radious;
}
}
public class circletest
{
public static void main(String[] args)
{
circle r;
r=new circle();
System.out.println("圆的半径是:"+r.radious);
double result=r.area();
System.out.println("圆的面积是:"+result);
}
}
class circle
{
int radious=10;
double area()
{
double PI=3.14;
return PI*radious*radious;
}
}