interface A {
default void m() {
System.out.println("Hello from A");
};
}
interface B extends A {
default void m() {
System.out.println("Hello from B");
};
}
interface C extends A {
}
class D implements B, C {
}
public class Main {
public static void main(String[] args) {
D obj = new D();
obj.m();
}
}
I am unable to come to a decision why do i get an output..I have modeled this problem as diamond problem.. Is This model similar to Diamond Problem ? But It works Fine in Java .....Why?