1.

How method overloading is different from method overriding?

Answer»

Method overloading MEANS methods are having the same name, but they differ either in the number of arguments or in the type of arguments. It is DONE during compile time, so it is known as compile-time POLYMORPHISM.

Method OVERRIDING means the ability to define subclass and super-class methods with the same name as well as the same method SIGNATURES, here the subclass method will override the super-class method. It is performed during run time, so it is known as run-time polymorphism.



Discussion

No Comment Found