编写2个接口:InterfaceA和InterfaceB;在接口InterfaceA中有个方法void printCapitalLetter();在接口InterfaceB中有个方法void prin...

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 prin..._第1张图片

 

转载于:https://www.cnblogs.com/HRZJ/p/5902390.html

你可能感兴趣的:(编写2个接口:InterfaceA和InterfaceB;在接口InterfaceA中有个方法void printCapitalLetter();在接口InterfaceB中有个方法void prin...)