代码:class Circle{
double radius; double getArea(){ double area=3.14*radius*radius; return area; } }public class Example4_2{ public static void main(String[] args){ Circle circle =new Circle(); circle.radius=12.23; double area=circle.getArea(); System.out.printf("半径是%5.3f的圆的面积是:\n%5.3f\n",circle.radius,area); } }