public interface IntefaceHuidiao {
void showMessage();
}
public class PC implements IntefaceHuidiao {
public void showMessage() {
System.out.println("我是电脑!");
}
}
public class TV implements IntefaceHuidiao {
public void showMessage() {
System.out.println("我是电视机!");
}
}
public class TestIntefaceHudiao {
public static void main(String[] args) {
IntefaceHuidiao ms ;
ms = new TV();
ms.showMessage();
ms = new PC();
ms.showMessage();
}
}