34.编写2个接口:InterfaceA和InterfaceB;在接口InterfaceA中有个方法void printCapitalLetter();在接口InterfaceB中有个方法void printLowercaseLetter();然 后写一个类Print实现接口InterfaceA和InterfaceB,要求printCapitalLetter()方法 实现输出大写英文字母表的功能,
package zuoye; public class jiekoua { public interface IInterfaceA { void printCapitalLetter(); } }
package zuoye; public class jiekoub { public interface IInterfaceB { void printLowercaseLetter(); } }
package zuoye; import zuoye.jiekoua.IInterfaceA; import zuoye.jiekoub.IInterfaceB; public class Print implements IInterfaceA, IInterfaceB { @Override public void printLowercaseLetter() { System.out.println("abc"); } @Override public void printCapitalLetter() { System.out.println("ABC"); }
package zuoye; public class E2 { public static void main(String[] args) { Print p=new Print(); Print a=p; Print b=p; a.printCapitalLetter(); b.printLowercaseLetter(); } }