Wednesday, September 18, 2013

Overloading and Overriding


Method overriding, in object oriented programming, is a language feature that allows a subclass or child class to provide a specific implementation of a method that is already provided by one of its superclasses or parent classes.

Function overloading or method overloading is a feature found in various programming languages such as AdaC++C#D, and Java, that allows creating several methods with the same name which differ from each other in the type of the input and the output of the function. It is simply defined as the ability of one function to perform different tasks.

Operator overloading...

template function overloading:

template void fun(T1,T2){}
//template void fun(C,T){} // WRONG
template void fun(T2,T1){} // Correct, different signature!

No comments: