Method Overloading
- The same class shares the same name but each method must have different number of parameters or parameters having different types and order.
- Method Overloading means more than one method shares the same name in the class but having different signature.
- Method Overloading is to “add” or “extend” more to method’s behavior.
Method Overriding
- The sub class have the same method with same name and exactly the same number and type of parameters and same return type as a super class.
- Method Overriding means method of base class is re-defined in the derived class having same signature.
- Method Overriding is to “Change” existing behavior of method.
Thanks and Regards,
Tech Bird
Comments