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


Please Help Members By Posting Answers For Below Questions

Can we get the value of ios format flags?

655


How to access a variable of the structure?

582


Describe private, protected and public?

594


C is to C++ as 1 is to a) What the heck b) 2 c) 10

634


Describe new operator and delete operator?

622






Can union be self referenced?

569


How to tokenize a string in c++?

600


Must accepts "Maestro Cards" Tax for bike should be less than 15 Total number of lanes is more than 10 Must provides monthly pass Write a method: boolean isGoodTollBridge(String[] cardsAccepted, String[] tollTax, boolean hasMonthlyPass, int numberOfLanes); String[] cardsAccepted A String array of names of card types accepted for payment of toll tax, it can be null if the toll does not accept any card String[] tollTax A String array of toll tax chart (say “Train : 300”,”BullCart : 10”) boolean hasMonthlyPass This parameter defines whether there is any monthly pass available or not int numberOfLanes This parameter defines the number of lanes for each side

3042


How can I disable the "echo" feature?

601


Is c++ a good beginners programming language?

580


What is a hashmap c++?

564


Is c++ built on c?

556


Which format specifier is used for printing a pointer value?

569


Can we use this pointer in a class specific, operator-overloading function for new operator?

609


How can you quickly find the number of elements stored in a static array?

631