I wrote a program in Java with 2 interface and a class.
Both the interface has the same method name.
In the main class i am implementing both the interfaces and called the method. I want to know which interface method is called...
Here is the sample code :-
public interface A {
void print();
}
public interface B {
void print();
}
public class C implements A, B {
public static void main(String[] args) {
C c = new C();
c.print();
}
public void print() {
System.out.println("sample");
}
}