Podcast
Questions and Answers
What is the role of virtual base class in inheritance?
What is the role of virtual base class in inheritance?
- Restricts access to derived classes
- Prevents multiple inheritance
- Prevents access to base class members
- Enables sharing of common base class (correct)
What is the purpose of namespaces in C++?
What is the purpose of namespaces in C++?
- Enforcing data encapsulation
- Defining class hierarchies
- Handling exceptions
- Avoiding naming conflicts (correct)
Which inheritance type involves a derived class having more than one base class?
Which inheritance type involves a derived class having more than one base class?
- Multilevel inheritance
- Multiple inheritance (correct)
- Hierarchical inheritance
- Single inheritance