Method overloading and rewrite

Overloading and rewrite the difference between:

Method overloading method refers to a plurality of the same class have the same name, but these methods have a different list of parameters, i.e. the number or type of parameters can not be exactly the same parameters

Rewriting method, the subclass definition methods exist between sub-parent and parent class method with the same name of the method, the same parameters and the same return type table 

Subclass will cover methods subclass, to call the parent class method needs to call super () method

Guess you like

Origin www.cnblogs.com/Sky-Aces/p/11294988.html