enfrptes

sendassignment@tutorspoint.com

Extends and Implements Keyword Homework Help

What is the difference between extends and implements keywords in Java?
Using extends keyword we get properties of one structure to another structure.

Using the implements keyword we provide bodies for function definitions inside a structure (interface).
In simple terms, extends means getting and implements mean giving.
Therefore functionality of implements is suited opposite to that of extends.
Hence implements are against inheritance.

Example:
Father             Son  
Child-1            Father is the superclass
Child-2            Son is a subclass
Child-3            Child 1, 2, and 3 are interfaces

Son has to extend from a father and can implement to all children. This is the reason why we can extend only one class but can implement any number of interfaces.