HeapTrace interview question

What is difference between function overriding and function overloading.

Interview Answer

Anonymous

30 Nov 2023

Function overloading is compile time polymorphism and it is done in single class. If function have logical implementation same then in this case we can give the same name to function but different no of parameters or type of at least one parameters different Function overriding is runtime polymorphism and it is done in two different classes in parent class have one method if child class want extend the meaning of that method then in this case we can overriding this method in child class.