public abstract class Shape{
public abstract void Circle();
public abstract void Area();
}
public class Rectangle extends Shape{
int a=2;
int b=3;
public void Circle();
public void Area();
System.out.println("矩形的周长="+2*(a+b));
System.out.println("矩形的面积="+a*b);
}
public class Circle extends Shape{
double r=3.15;
double P=3.14;
public void Circle();
public void Area();
System.out.println("圆形的周长="+2Pr);
System.out.println("圆形的面积="+Pr*r);
}
public static void main(Spring[] args){
Shape i=new Rectangle();
i.Circle();
i.Area();
Shape j=new Circle();
j.Circle();
j.Area();
}