What is virtual Function.



What is virtual Function...

Answer / poonam

Virtual function is a function that uses keyword "virtual"
with the datatype of the function. When the base class as
well as the derived class contains a function both having
the same name, just to resolve ambiguity and copy of the
same data again and again we use the keyword "virtual"
preeceeding it. It is used to achieve poymorphism.

Is This Answer Correct ?    7 Yes 0 No

Post New Answer

More OOPS Interview Questions

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.

0 Answers  


What is destructor oops?

0 Answers  


How do you use inheritance in unity?

0 Answers  


What is and I oop mean?

0 Answers  


assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).

0 Answers  






What is abstraction with example?

0 Answers  


What is the difference between encapsulation and polymorphism?

0 Answers  


Can we create object of interface?

0 Answers  


what is the difference between a package and a software?

3 Answers  


i^=j; j^=i; i^=j; value of i,j

1 Answers  


What are the benefits of oop?

0 Answers  


What is inheritance write a program to show use of inheritance?

0 Answers  


Categories