1/11
Looks like no tags are added yet.
What is an interface in Java?
An interface is a blueprint that defines methods a class must implement.
What keyword creates an interface?
interface
What keyword connects a class to an interface?
implements
Can a class implement multiple interfaces?
Yes. Java allows a class to implement multiple interfaces.
Can you directly create an object of an interface?
No. Interfaces cannot be instantiated directly.
What kind of methods are abstract by default in an interface?
Methods without a body are abstract by default.
What must a class do when implementing an interface?
Implement all required abstract methods, or be declared abstract itself
Can an interface contain variables?
Yes. Variables are automatically public, static, and final.
What does abstract mean?
A method has no implementation body and must be implemented by a concrete class.
Can interfaces extend other interfaces?
Yes. An interface can extend one or multiple interfaces.
What is the difference between extends and implements?
extends inherits a class or interface.
implements connects a class to an interface.