Code: Select all
firstInterface.super.getTest();
Code: Select all
public interface firstInterface {
public default int getTest(){
return 5;
}
}
public interface secondInterface extends firstInterface {
public int getTest();
}
public class A implements firstInterface, secondInterface {
@Override
public int getTest() {
System.out.println("implemented method is called");
return 6;
}
public class TEST3 {
public static void main(String[] args) {
A sp = new A(5);
sp.getTest();
//firstInterface.super.getTest(); // compile error
((firstInterface)sb).getTest();
}
}
implemented method is called
implemented method is called