标签:
package com.homework3; public interface CentralPartyCommittee { //声明抽象方法 void partyLeader(); }
package com.homework3; //声明抽象类 public abstract class StateCouncil { //声明抽象方法 abstract void safetyInProduction(); }
package com.homework3; public class Province extends StateCouncil implements CentralPartyCommittee { @Override public void partyLeader() { System.out.println("我们各省人民一定坚持党的领导!"); } @Override void safetyInProduction() { System.out.println("我们各省人民一定按照国务院的指示进行安全生产!"); } }
package com.homework3; public class E { public static void main(String[] args) { //创建Province对象 Province p = new Province(); p.partyLeader(); p.safetyInProduction(); } }
标签:
原文地址:http://www.cnblogs.com/HRZJ/p/5902395.html