🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Inheritance and Virtual Functions: all 10 questions

Quiz: Inheritance and Virtual Functions · Question 5 of 10

What does the override keyword do?

What does the override keyword do?

  1. A.Makes a function virtual in the base
  2. B.Makes the compiler check that the function really overrides a base virtual function
  3. C.Hides the base class
  4. D.Deletes the base function
Answer & explanation

Correct answer: Makes the compiler check that the function really overrides a base virtual function

It catches mistakes like a misspelled name or wrong parameters.

Can you get the rest right without peeking?

Take the timed Quiz: Inheritance and Virtual Functions quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →