When we implement multiple iheritance for the class RunExample it is running fine without any issues or errors at compile time or runtime. How does jvm knows which method to implement when same methods are declared in different interfaces?
package InterfaceSegregation;
public interface A {
public void work();
public void takeBreak();
}
package InterfaceSegregation;
public interface B {
public void takeBreak();
}
package InterfaceSegregation;
public class RunExample implements A,B{
public static void main(String[] args){
RunExample e = new RunExample();
System.out.println(e instanceof A);
System.out.println(e instanceof B);
}
@Override
public void work() {
// TODO Auto-generated method stub
}
@Override
public void takeBreak() {
}
}