34.编写2个接口:InterfaceA和InterfaceB;在接口InterfaceA中有个方法void printCapitalLetter();在接口InterfaceB中有个方法void printLowercaseLetter();然 后写一个类Print实现接口InterfaceA和InterfaceB,要求printCapitalLetter()方法 实现输出大写英文字母表的功能,

//接口InterfaceA

package jieKou;

public interface IInterfaceA {
void printCapitalLetter();

}

//接口InterfaceB

package jieKou;

public interface IInterfaceB {
void printLowercaseLetter();

}

//类print
package jieKou;

public class Print implements IInterfaceA, IInterfaceB {

@Override
public void printLowercaseLetter() {
	System.out.println("abc");

}

@Override
public void printCapitalLetter() {
	System.out.println("ABC");

}

}

//主类E
package jieKou;

public class E {

public static void main(String[] args) {
	Print p=new Print();
	IInterfaceA a=p;
	IInterfaceB b=p;
	a.printCapitalLetter();
	b.printLowercaseLetter();

}

}

posted @ 2016-09-23 21:21  削肾客  阅读(898)  评论(0编辑  收藏  举报