1.

Which statement is incorrect about virtual function.(a) They are used to achieve runtime polymorphism(b) They are used to hide objects(c) Each virtual function declaration starts with the virtual keyword(d) All of the mentionedThis question was posed to me by my college director while I was bunking the class.My query is from Inheritance in portion Class Hierarchies, Library & Containers of C++

Answer» RIGHT CHOICE is (b) They are used to hide objects

Best explanation: VIRTUAL function are used to achieve runtime polymorphism by CALLING the right function during runtime. Their declaration STARTS with a virtual keyword.


Discussion

No Comment Found

Related InterviewSolutions