Answer Posted / shivam`
There are two types of polymorphism.
1. Compile time polymorphism - It is achieved by
overloading functions and operators
2. Run time polymorphism - It is achieved by overriding
virtual functions
Lets say you have a class that have many Load methods having
different parameters, this is called Compile time
polymorphism. Lets take another example where you have a
virtual method in the base class called Load with one
parameter and you have redefined its functioanlity in your
sub class by overriding base class Load method, this is
called Run time polymorphism.
Is This Answer Correct ? | 6 Yes | 3 No |
Post New Answer View All Answers
What exactly is polymorphism?
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.
Write a program to sort the number with different sorts in one program ??
What is static in oop?
What is polymorphism in oop example?
program for insertion ,deletion,sorting in double link list
What is pure oop?
When not to use object oriented programming?
What do you mean by Encapsulation?
What are the features of oop?
Why do we use inheritance?
Which is better struts or spring?
What is inheritance and how many types of inheritance?
What is coupling in oop?
What is inheritance in oop?