A ________ function is a member function in base class that you expect to…
2018
A ________ function is a member function in base class that you expect to redefine in derived classes.
- A.
Friend
- B.
Virtual
- C.
Private
- D.
Protected
Attempted by 120 students.
Show answer & explanation
Correct answer: B
A virtual function is declared in a base class using the virtual keyword to enable polymorphism. This allows derived classes to override the function, ensuring the correct implementation is called at runtime based on the object type.