Thursday, June 25, 2020

Important Difference: Method Overloading v/s Method Overriding

Here is a very important difference which leads to confusion for many new programmers:

1) Method Overloading: In the same class, we have two methods with the same name but with different parameters.

2) Method Overriding: In the sub-class, we have a method with the same name as in parent class and with the same parameters. This is usually done to have a different functionality in the sub-class.

No comments:

Post a Comment

Total Magnification

If a microscope has objective magnification (Mo) of 10x and eyepiece magnification (Me) of 10x, then total magnification (Mt) is given as: M...