interface1 have default method "void printMsg()"
public interface Interface1 {
default void printMsg(){
System.out.println("interface1");
}
}
interface2 also have default method "void printMsg()"
public interface Interface2 {
default void printMsg(){
System.out.println("interface2");
}
}
interface3 extends both interfaces
public interface Interface3 extends Interface1, Interface2{}
now ClassA have both methods Interface1.printMsg() and Interface2.printMsg()
class ClassA implements Interface3{
ClassA(){}
}
what output of code below, and why?
new ClassA().printMsg();