class Circle {
private double radius;
public Circle() {
this.radius = 1.0;
}
public Circle(double radius) {
this.radius = radius;
}
public double getRadius() {
return radius;
}
public void setRadius(double radius) {
this.radius = radius;
}
public double getArea() {
return Math.PI * radius * radius;
}
}
public class TestCircle {
public static void main(String[] args) {
Circle circle1 = new Circle();
Circle circle2 = new Circle(5.0);
Circle circle3 = new Circle();
circle1.setRadius(3.0);
circle2.setRadius(10.0);
System.out.println("Circle 1: radius = " + circle1.getRadius() + ", area = " + circle1.getArea());
System.out.println("Circle 2: radius = " + circle2.getRadius() + ", area = " + circle2.getArea());
System.out.println("Circle 3: radius = " + circle3.getRadius() + ", area = " + circle3.getArea());
}
}