C++ Virtual Functions Question:

Download Job Interview Questions and Answers PDF

What is virtual methods?

C++ Virtual Functions Interview Question
C++ Virtual Functions Interview Question

Answer:

virtual methods are used to use the polymorphism feature in C++. Say class A is inherited from class B. If we declare say function f() as virtual in class B and override the same function in class A then at run time appropriate method of the class will be called depending upon the type of the object.

Download C++ Virtual Functions Interview Questions And Answers PDF

Previous QuestionNext Question
Explain the pure virtual functions?What is a virtual base class?