JAVA---用面向对象的方法求圆的面积
package lll;
public class Test {
public static void main(String[] args) {
Circle c1=new Circle();
c1.radius=2;
System.out.println(c1.findArea());
}
}
class Circle{
double radius;
public double findArea(){
return Math.PI*radius*radius;
}
}