interface InterfaceA
{
default void sayHello()
{
System.out.println("default Hello by InterfaceA...");
}
}
InterfaceB.java public interface InterfaceB
{
default void sayHello()
{
System.out.println("default Hello by InterfaceB...");
}
}
MyClass.java public class MyClass implements InterfaceA,InterfaceB
{
public void sayHello()
{
InterfaceA.super.sayHello();
}
}
InterfaceTest.java public class InterfaceTest
{
public static void main(String[] args)
{
InterfaceA interfaceARef = new MyClass();
interfaceARef.sayHello();
}
}