What is the difference between extends and implements in Java?
1. In the declaration of a class, create a subclass of a class with the keyword extends. A class declares itself to use one or more interfaces through the keyword implements.
Extends is inherited from a class, you can use the parent class method after inheritance, or you can override the parent class method; Implements is to implement multiple interfaces, the method of the interface is generally empty and must be rewritten to use
2.extends is inherited from the parent class, as long as the class is not declared final or the class is defined as abstract can inherit, Java does not support multiple inheritance, but can be implemented with interfaces, so it is necessary to use implements, inheritance can inherit only one class, But implements can implement multiple interfaces, separated by commas.
Like what
Class A extends B implements C,d,e
Turn ~~~~~~
Differences between extends and implements in Java