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
#include
What is constructor in oop?
What is coupling in oops?
What is an advantage of polymorphism?
What is byval and byref? What are differences between them?
Why is oop better than procedural?
#include
What is object in oop with example?
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.
What is stream in oop?
Can a destructor be called directly?
class type to basic type conversion
2. Give the different notations for the class.\
How to call a non virtual function in the derived class by using base class pointer
What is coupling in oop?