1. Home
  2. Computer Science MCQs
  3. C++ and Object-Oriented Programming
  4. A class becomes abstract in C++ when it does which of these?

Added 30 Nov -0001

A class becomes abstract in C++ when it does which of these?

  1. Declares at least one pure virtual function Correct answer
  2. Keeps all data members private
  3. Provides no user-defined constructor
  4. Inherits privately from another class

Correct answer

A. Declares at least one pure virtual function

11 views

MCQSEXAM

Explanation

A pure virtual function makes the class abstract, so no objects of that class can be created.

Reference

Asked in: NTS, PPSC IT, Campus Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is A? 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