InterviewSolution
| 1. |
What Are Virtual Functions And What Is Its Use? |
|
Answer» Virtual functions are member functions of class which is declared using keyword 'virtual'. When a base class type REFERENCE is initialized using object of sub class type and an overridden method which is declared as virtual is invoked using the base reference, the method in CHILD class object will get invoked. Virtual functions are member functions of class which is declared using keyword 'virtual'. When a base class type reference is initialized using object of sub class type and an overridden method which is declared as virtual is invoked using the base reference, the method in child class object will get invoked. |
|