1. Home
  2. Computer Science MCQs
  3. C++ and Object-Oriented Programming
  4. The default access specifier for members of a class in C++…

Added 30 Nov -0001

The default access specifier for members of a class in C++ is:

  1. public
  2. protected
  3. internal
  4. private Correct answer

Correct answer

D. private

15 views

MCQSEXAM

Explanation

Members of a class are private by default; those of a struct are public by default.

Reference

Asked in: NTS, PPSC IT, Campus Interviews

Preparing for an exam?

Doubts & discussion

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