HTML & JS
// A simple Java program to demonstrate multiple
// inheritance through default methods.
interface TestInterface1
{
    // default method
    default void show()
    {
        System.out.println("Default TestInterface1");
    }
}

interface TestInterface2
{
    // Default method
    default void show()
    {
        System.out.println("Default TestInterface2");
    }
}

// Implementation class code
class TestClass implements TestInterface1, TestInterface2
{
    public static void main(String args[])
    {
        TestClass d = new TestClass();
        d.show();
    }
}

Generated URL:

Warnings:

22: error: class TestClass inherits unrelated defaults for show() from types TestInterface1 and TestInterface2
class TestClass implements TestInterface1, TestInterface2
^
1 error

Output:

No Output
Report Bug