Mastering C++: A Comprehensive Quiz Based on 'Thinking in C++'

Disable ads (and more) with a membership for a one time $2.99 payment

Challenge your C++ knowledge with a comprehensive quiz based on 'Thinking in C++'. Explore a variety of multiple choice questions with hints and explanations to solidify your understanding. Get prepared!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


In C++, what does the default access level of inherited members become if not specified?

  1. Public

  2. Private

  3. Protected

  4. Static

The correct answer is: Private

When specifying inheritance in C++, the default access level of all inherited members becomes "private" if not explicitly stated. This means that the inherited members will only be accessible within the class that they were inherited from, and not outside of it. This option is incorrect because specifying "private" as the default access level of inherited members is a unique feature of C++, and may not apply to other programming languages. Options A and C are incorrect because they are the possible access levels that can be explicitly specified in C++ when inheriting members, and are not the default. Option D is incorrect because "static" does not pertain to the access level of inherited members, but rather refers to a different concept in programming.