public interface A {
    default void m1() {
        System.out.println("m1 inside A");
    }
}

public class B implements A {
    //should be public because cannot reduce the visibility of method and 
    //by default, in interface, the access level is public
    public void m1() {
        System.out.println("m1 inside B");
    }
}

So we are not allowed to have a class that implements two interfaces with the same default methods without providing

a overridden implementation of that method.

results matching ""

    No results matching ""