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

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

package com.homework1;public interface InterfaceA {    //声明抽象方法    void printCapitalLetter();}
package com.homework1;public interface InterfaceB {    //声明抽象方法    void printLowercaseLetter();}
package com.homework1;public class Print implements InterfaceA, InterfaceB {    @Override    public void printLowercaseLetter() {        System.out.println("abcdefghigklmnopqrstuvwxyz");    }    @Override    public void printCapitalLetter() {        System.out.println("ABCDEFGHIJKLMNOPQRSTUVWXYZ");    }}
package com.homework1;public class Print implements InterfaceA, InterfaceB {    @Override    public void printLowercaseLetter() {        System.out.println("abcdefghigklmnopqrstuvwxyz");    }    @Override    public void printCapitalLetter() {        System.out.println("ABCDEFGHIJKLMNOPQRSTUVWXYZ");    }}

技术分享

 

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