You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
383 B
20 lines
383 B
class Shape {
|
|
public void draw() {
|
|
System.out.println("绘制一个形状");
|
|
}
|
|
}
|
|
|
|
class Circle extends Shape {
|
|
@Override
|
|
public void draw() {
|
|
System.out.println("绘制一个圆形 ○");
|
|
}
|
|
}
|
|
|
|
class Rectangle extends Shape {
|
|
@Override
|
|
public void draw() {
|
|
System.out.println("绘制一个矩形 ▭");
|
|
}
|
|
}
|
|
|
|
|