"... So according to the above code does interface in Java extends object class internally?"
Contrary to everyone's responses, I believe I did read this somewhere.
Although, this doesn't mean they are wrong—it depends on what you mean by "internally".
Here is the Java Language Specification entry.
Java Language Specification – 4.3.1. Objects.
"An object is a class instance or an array. ...
... A class instance is explicitly created by a class instance creation expression (§15.9)."
So, in terms of a "class instance creation expression", from 15.9,
"ClassInstanceCreationExpression:
UnqualifiedClassInstanceCreationExpression
ExpressionName . UnqualifiedClassInstanceCreationExpression
Primary . UnqualifiedClassInstanceCreationExpression
UnqualifiedClassInstanceCreationExpression:
new [TypeArguments] ClassOrInterfaceTypeToInstantiate ( [ArgumentList] ) [ClassBody]
ClassOrInterfaceTypeToInstantiate:
{Annotation} Identifier {. {Annotation} Identifier} [TypeArgumentsOrDiamond]"
As ClassOrInterfaceTypeToInstantiate defines it, the compiler will interpret the interface as an object.
Or, maybe a better way to say it is, the interpreter is going to schedule the interface as an object.
Essentially, this is referring to the anonymous inner-class.
abc abc = new abc() {
@Override
public void meth1() {
}
};