标签:
1 public interface CentralPartyCommittee { 2 void partyLeader(); 3 4 }
1 public class StateCouncil { 2 3 void safetyInProduction() { 4 System.out.println("安全生产"); 5 } 6 }
1 public class Province extends StateCouncil implements CentralPartyCommittee { 2 3 @Override 4 public void partyLeader() { 5 System.out.println("我们各省人民一定坚持党的领导"); 6 } 7 8 void safetyInProduction() { 9 System.out.println("我们各省人民一定按照国务院的指示进行安全生产!"); 10 } 11 }
1 public static void main(String[] args) { 2 3 Province a= new Province(); 4 a.partyLeader(); 5 a.safetyInProduction(); 6 7 }
运行:
标签:
原文地址:http://www.cnblogs.com/ouyangtangfeng99/p/5523325.html