Posted On: Dec 22, 2020
Few differences between overloading and overriding are as follows:
|S. N.||Method overloading||Method overriding|
|(1)||In this, methods must have the same name and different signatures.||While in this, methods must have the same name and same signature.|
|(2)||Method overloading is performed within class.||Method overriding occurs in two classes that have IS-A (inheritance) relationship.|
|(3)||In case of method overloading, parameters must be different.||In case of method overriding, parameters must be the same.|
|(4)||Method overloading is the example of compile time polymorphism.||Method overriding is the example of run time polymorphism.|
Never Miss an Articles from us.