difference between keyword implement and extend | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

difference between keyword implement and extend

28th Jun 2016, 12:33 PM
Archana kumari
3 Answers
+ 3
The keyword 'extends' is used when a sub class inherits a super class or a sub interface inherits a super interface. A sub class can EXTEND only one super class in Java but a sub interface can EXTEND multiple interfaces. The keyword 'implements' is used when a class uses an interface. The key point to note here is that a class can EXTEND only one super class but the same class can IMPLEMENT multiple interfaces at a time but while defining EXTENDS should come first..
28th Jun 2016, 6:49 PM
Shraddha -
Shraddha - - avatar
0
Java can only extends one class, while implements many interface.
28th Jun 2016, 2:34 PM
Chaie Li
Chaie Li - avatar
0
whenever we need to define the methods we use implements and for inheritance we use extends
4th Jul 2016, 12:12 PM
Shipra Chordia
Shipra Chordia - avatar