package JDK8;
public interface CompareA {
public static void method1() {
System.out.println("CompareA:xian");
}
public default void method2() {
System.out.println("CompareA:hangzhou");
}
default void method3() {
System.out.println("CompareA:hangzhou");
}
}
package JDK8;
public interface CompareB {
default void method3() {
System.out.println("CompareB:xian");
}
}
package JDK8;
public class SuperClass {
public void method3() {
System.out.println("SuperClass:hangzhou");
}
}
package JDK8;
public class SubClassTest {
public static void main(String[] args) {
CompareA.method1();
SubClass sc=new SubClass();
sc.method3();
sc.method2();
sc.MyMethod();
}
}
class SubClass extends SuperClass implements CompareA,CompareB{
public void method2() {
System.out.println("SubClass:渭南");
}
public void method3() {
System.out.println("hello");
}
public void MyMethod() {
method3();
super.method3();
CompareA.super.method2();
CompareB.super.method3();
}
}