public class MainClass{ public static void main(String[] argv){ MyInterface i = new MyClass(); } } interface MyInterface{ public void aMethod(); } interface MySubinterface extends MyInterface{ public void bMethod(); } class MyClass extends MySubinterface{ public void aMethod(){ } public void bMethod(){ } }
Exception in thread "main" java.lang.Error: Unresolved compilation problem: Type mismatch: cannot convert from MyClass to MyInterface at MainClass.main(MainClass.java:3)