Difference between over loading and over ridding?

Answer Posted / manav sharma

Overloading: Same function or operator responds differently
on different types on inputs. This is done by defining a
function (including operator fn() definition) with the same
name but different argument list.

Overriding: Redefining any base class function in a
derieved class to work differently than what is defined in
the base class. So, now the same function called with same
argument list will behave differently when called on the
objects of base and derieved class.

Important: Which instance of function to bind with the
object depends on the type of object on which the function
is called and is decided on compile time. This is also
called early binding or compile time polymorphism.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is advantage of inheritance?

929


Why do while loop is used?

769


Which method cannot be overridden?

764


given a set based questions and 5 questions based on it next data sufficiciency questions 2 and 2/3 english sentence completion with options very easy and 2 synononmys paragraph with 10 questions 10 minutes replace =,-,*,% with -,%,+,* type questions 5 3 questions lik following itssickhere itssickthere itssickhere istsickhere which is nt alike the others very easy

2366


i got a backdoor offer in process global,Bangalore..Can i work with it?

2576


Can private class be inherited?

899


String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?

2149


What are the three main types of variables?

829


What is the problem with multiple inheritance?

821


write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.

1983


Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.

924


What is abstraction in oop?

852


What is encapsulation oop?

794


Can an interface inherit a class?

779


What are the benefits of interface?

800