// Telphone.java public abstract class Telphone{ public abstract void call(); public abstract void message(); } // CellPhone.java public class CellPhone extends Telphone{ @Override public void call(){ System.out.println("键盘打电话"); } @Override public void message(){ System.out.println("键盘发短信"); } } //ModernPhone.java public class ModernPhone extends Telphone{ @Override public void call(){ System.out.println("语音打电话"); } @Override public void message(){ System.out.println("语音发短信"); } } //Test.java public class Test{ public static void main(String[] args){ Telphone te1 = new CellPhone(); te1.call(); te1.message(); Telphone te2 = new ModernPhone(); te2.call(); te2.message(); } }