1. Home
  2. Computer Science MCQs
  3. C++ and Object-Oriented Programming
  4. What is the effect of writing override after a member…

Added 30 Nov -0001

What is the effect of writing override after a member function declaration?

  1. The function is inlined at every call site
  2. The compiler verifies it overrides a base method Correct answer
  3. The base version is removed from the vtable
  4. Subclasses may no longer override it

Correct answer

B. The compiler verifies it overrides a base method

15 views

MCQSEXAM

Explanation

override makes the compiler reject the declaration if no matching virtual base function exists.

Reference

Asked in: NTS, PPSC IT, Campus Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More C++ and Object-Oriented Programming MCQs

Practise all C++ and Object-Oriented Programming MCQs

Similar MCQs