Overloading vs. overriding

Overloading vs. overriding.

- Overriding of functions occurs when one class is inherited from another class. Overloading can occur without inheritance.
- Overloaded functions must differ in function signature ie either number of parameters or type of parameters should differ. In overriding, function signatures must be same.
- Overridden functions are in different scopes; whereas overloaded functions are in same scope.
- Overriding is needed when derived class function has to do some added or different job than the base class function.
- Overloading is used to have same name functions which behave differently depending upon parameters passed to them.
What is virtual destructor? What is its use?
What is virtual destructor? What is its use? - If the destructor in the base class is not made virtual, then an object that might have been declared....
What is object slicing? - C++
What is object slicing? - When a Derived Class object is assigned to Base class, the base class' contents in the derived object...
What is a data encapsulation?
What is a data encapsulation? - Data Encapsulation: The wrapping up of data and functions into a single unit (Class) is known as Encapsulation. .
Post your comment
Discussion Board
what kind of papar our next day and how we done be good programmer?answer quickely.thanx
Nabil 04-22-2016