public class ChapterHomework10{ public static void main(String[] args) { Circle c = new Circle(); PassObject P1 = new PassObject(); P1.printAreas(c, 5); } } class Circle{ double radius; public double findArea(){ return Math.PI*radius*radius; } //添加方法setRadius,修改对象的半径值 public void setRadius(double radius){ this.radius = radius; } } class PassObject{ public void printAreas(Circle c,int times){ System.out.println("radius\tarea"); for(int i = 1; i <= times; i++){ c.setRadius(i);//修改c对象的半径值 System.out.println((double)i + "\t" + c.findArea()); } } }