Answer Posted / tamil venthan
using virtual we can override the same function for
different sub classes ,By creating the pointer to the base
class we can allocate the separate memory for every
class(memory consumption)not for all classes
Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
Why it is called runtime polymorphism?
What is the purpose of polymorphism?
#include
What is the example of polymorphism?
What is encapsulation with example?
What is overriding in oop?
hi all..i want to know oops concepts clearly can any1 explain??
What are the benefits of oop?
What is class and object with example?
What is the real time example of inheritance?
What language is oop?
What is abstract class in oop?
What is encapsulation in ict?
Which is better struts or spring?
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.