Overload with Override

xiaoxiao2021-03-06  48

"OVERLOAD":

1, the OVERLOAD method is named, the number, the number, the order is at least one different;

2, can't overload only the method names that return values;

3, OverLoad exists in the parent class and subclasses, in the same kind.

"Override"

1. When OVERRIDE, the method name, parameter, and return value are the same;

2. Subclass methods cannot narrow the access rights of the parent method;

3. Submatory methods cannot throw more abnormalities than parent class methods (but the sub-class method can not throw an abnormality);

4, Override exists between the parent class and subclass.

转载请注明原文地址:https://www.9cbs.com/read-91219.html

New Post(0)