class Electic{
public void open(){
System.out.println("打开电器");
}
}
class Light extends Electic{
public void open(){
System.out.println("打开电灯");
}
}
class Computer extends Electic{
public void open(){
System.out.println("打开电脑");
}
}
class Fan extends Electic{
public void open(){
System.out.println("打开电扇");
}
}
public class Demo {
public static void main(String[] args){
Light a1=new Light();
Computer a2=new Computer();
Fan a3=new Fan();
a1.open();
a2.open();
a3.open();
}
}