import chapter4.shape.shape2D.Circle;
import chapter4.shape.shape2D.Rectangle;
class CirRecTest{
public static void main(String agrs[]){
Circle cir=new Circle(10);
System.out.println("圆的半径为:"+cir.getRadius());
System.out.println("圆的面积为:"+cir.area());
System.out.println("圆的周长为:"+cir.perimeter());
Rectangle rec=new Rectangle(10,20);
System.out.println("矩形的边长为:"+rec.getLength()+","+rec.getWidth());
System.out.println("举行的面积为:"+rec.area());
System.out.println("矩形的周长为:"+rec.perimeter());
}
}
编译报错的代码:
import chapter4.shape.shape2D.*;
class CirRecTest{
public static void main(String agrs[]){
Circle cir=new Circle(10);
System.out.println("圆的半径为:"+cir.getRadius());
System.out.println("圆的面积为:"+cir.area());
System.out.println("圆的周长为:"+cir.perimeter());
Rectangle rec=new Rectangle(10,20);
System.out.println("矩形的边长为:"+rec.getLength()+","+rec.getWidth());
System.out.println("举行的面积为:"+rec.area());
System.out.println("矩形的周长为:"+rec.perimeter());
}
}
哪位帮我看看吧?我想了好几天不知道错在哪里,郁闷!!!!