Difference between Overloading and Overriding?
Answer Posted / shoaib
1. Overloading doesn't block inheritence from the
superclass where as Overriding blocks inheritance.
2. Overloading -> If two functions having same name and return type, but with different type and/or number of arguments. Overriding -> When a function of base class is re-defined in the derived class
3. Overloading is compile time binding, where as overriding is dynamic binding
4. In overloading function name are same but signatures
parameters are different .while in overriding function name are as well as argument are same in drive class as in super class.
| Is This Answer Correct ? | 9 Yes | 2 No |
Post New Answer View All Answers
What are guid? Why does com need guids?
What is bubble sort c++?
Can we get the value of ios format flags?
Ask to write virtual base class code?
How many different levels of pointers are there?
What is a hash function c++?
How do pointers work?
What is the best c++ ide?
What is the difference between the indirection operator and the address of oper-ator?
How can we check whether the contents of two structure variables are same or not?
Explain static and dynamic memory allocation with an example each.
Out of fgets() and gets() which function is safe to use and why?
What methods can be overridden in java?
What is the first name of c++?
What is the best c++ compiler?