Ace Your C++ Skills 2025 – Rock the ‘Thinking in C++’ Challenge!

Question: 1 / 565

When is it suitable to use public inheritance?

When creating a completely new class

When specializing a class

Public inheritance is suitable when you want to create a class that is a more specialized version of another class. This means that the new class inherits the properties and behaviors of the base class, but also adds its own unique features. Option A is incorrect because you would use public inheritance when creating a more specialized version of an existing class, not a completely new one. Option C is incorrect because it mentions modifying a base class, which is not the purpose of public inheritance. Option D is incorrect because public inheritance is used to create a relationship between related classes, not unrelated ones.

Get further explanation with Examzify DeepDiveBeta

When modifying a base class to create a generic class

When building unrelated classes

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy