Interview Question

Do interfaces extend java.lang.Object?

Interfaces do not inherit from Object, although their implementing classes do.

💡 Concept ✅ Quick Revision ☕ Java

Answer

Java interfaces do not extend java.lang.Object. • An interface can extend one or more interfaces. • Every implementing class is still a subclass of Object. • Interface method lookup has special rules for public Object methods.

Example

Code
interface Named {
    String name();
}
System.out.println(Named.class.isInterface());
Output
true

Quick Revision

Interfaces do not inherit from Object, although their implementing classes do.