import java.util.HashMap;
public class Test {
public static void main(String[] args) {
Shape s = new Square (10);
s.draw();
Shape rect = new Rectangle();
s.draw();
}
}
interface Shape{
void draw();
}
class Square implements Shape{
@Override
public void draw() {
System.out.println("画正方形");
}
}
class Rectangle implements Shape{
@Override
public void draw() {
System.out.println("画长方形");
}
}