Which type of inheritance in C++ restricts a derived class from inheriting from more than one base class?
- Single inheritance
- Multiple inheritance
- Hierarchical inheritance
- Hybrid inheritance
Single inheritance restricts a derived class to inherit from only one base class. While C++ supports multiple inheritance, where a class can inherit from more than one class, single inheritance ensures there's a straightforward lineage from the base to the derived class, avoiding complexities and potential ambiguities.
Loading...
Related Quiz
- In a system that processes user commands, you notice that the if-else chain for command processing has become excessively long and difficult to manage. Which refactorization strategy might be most effective?
- Which of the following statements about the struct and class keywords is true?
- How does pass by reference in C++ handle underlying memory allocation?
- A function that calls itself directly or indirectly is known as a _______ function.
- What could be a reason for choosing pass by pointer over pass by reference in a function?