Posted On: Jan 07, 2021
Few difference between Overloading and Overriding are as follows:
|Overloading is the situation when two or more methods in one class have the same method name but different parameters.||Overriding is the situation that means having two methods with the same method name and parameters (i.e., method signature). One of the methods is in the parent class and the other is in the child class.|
|The real object type in the run-time, not the reference variable's type, determines which overridden method is used at runtime.||Overriding allows a child class to provide a specific implementation of a method that is already provided by its parent class. In contrast, reference type determines which overloaded method will be used at compile time.|
|Polymorphism applies to overriding.||Polymorphism does not apply to overloading.|
|Overriding is a concept of run-time.||Overloading is a concept of compile-time.|
Never Miss an Articles from us.