The difference between java and reload rewritten

Method overloading

The method of creating a plurality of classes having the same name, but with different parameters and definitions

Method overrides

1. polymorphisms between parent and subclasses of the parent class is redefined.

2. A new method to overwrite the original method.

3. The return value must be the same type as the original method.

 

Guess you like

Origin www.cnblogs.com/NeverGiveUp0/p/11118239.html