In above example, we have defined one empty Interface and one empty Class which implements Interface.
Try to run this java program, at #15, we get the output Class@6d06d69c something like that. But Instead of output, Compiler should throw an exception. Because toString method (Object Class Method) is not defined in the Interface.
If we check the parent of Class, It returns Object Class (#17) and parent of Inteface is null (#18).
It means Class gets the reference of toString method from the Object Class, but Interface has no any reference of toString method then why compiler is not throwing an exception ?
Lets dive into the Java Langauage Specification (§9.2).
If an interface has no direct superinterfaces, then the interface implicitly declares a public abstract member method m with signature s, return type r, and throws clause t corresponding to each public instance method m with signature s, return type r, and throws clause t declared in Object, unless an abstract method with the same signature, same return type, and a compatible throws clause is explicitly declared by the interface.In simple words, interface (which is not extending any interface) implicitly declares Methods of Object Class.