该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
1、class Shape{
public void draw() { System.out.println(“draw Shape”); }
}
class Circle extends Shape{
public void draw() { System.out.println(“draw Circle”); }
}
class Rectangle extends Shape{
public void draw() { System.out.println(“draw Rectangle”); }
}
public class ShapeTest{
public static void main(String[] args){
Shape[] shapes=new Shape[3];
Shape[0]=new Shape();
Shape[1]=new Circle();
Shape[2]=new Rectangle ();
for(int i=0;i
shapes[i].draw();
}
}
2、class Person{
private static int count=0;
String name;
public Person(String name) {
this.name=name;
count++;
}
public