In C++, which type of inheritance allows a class to inherit properties and behavior from multiple base classes?
A. Multilevel inheritance
B. Hierarchical inheritance
C. Multiple inheritance
D. Single inheritance
Select an option to see the answer and solution.
What is the access specifier that restricts access to members of a class to only its derived classes in C++?
A. public
B. private
C. friend
D. protected
Select an option to see the answer and solution.
What is the process of defining a new class based on an existing class in C++ called?
A. Inheritance
B. Composition
C. Encapsulation
D. Polymorphism
Select an option to see the answer and solution.
Which keyword is used to signify inheritance in C++?
A. extends
B. inherit
C. using
D. : public
Select an option to see the answer and solution.
In C++, which access specifier allows members of a base class to be accessible in the derived class but not to the outside world?
A. friend
B. private
C. public
D. protected
Select an option to see the answer and solution.
What is the diamond problem in C++?
A. Ambiguity in single inheritance
B. Ambiguity in hierarchical inheritance
C. Ambiguity in multiple inheritance
D. Ambiguity in multilevel inheritance
Select an option to see the answer and solution.
What is the default access specifier for members of a class in C++ when using inheritance?
A. protected
B. private
C. friend
D. None of the above
Select an option to see the answer and solution.
What happens if a derived class redefines a method that is already defined in its base class in C++?
A. Compilation error
B. Both methods are available separately
C. Method in the derived class overrides the base class method
D. Method in the base class overrides the derived class method
Select an option to see the answer and solution.
In C++, which type of inheritance is not supported directly but can be achieved using a combination of other types of inheritance?
A. Multiple inheritance
B. Single inheritance
C. Hierarchical inheritance
D. Hybrid inheritance
Select an option to see the answer and solution.
What is the name for the process by which a class inherits features from another class in C++?
A. Derivation
B. Combination
C. Composition
D. Encapsulation
Select an option to see the answer and solution.
In C++, if a derived class does not define a constructor, which constructor of the base class is called during the object creation of the derived class?
A. No constructor is called
B. Destructor of the base class
C. Parameterized constructor of the base class
D. Default constructor of the base class
Select an option to see the answer and solution.
What is the process of creating a new class using an existing class as a base in C++?
A. Base class
B. Derived object
C. Derived class
D. Base object
Select an option to see the answer and solution.
What is the name given to the feature of C++ where a class inherits features from more than one base class?
A. Hierarchical inheritance
B. Multiple inheritance
C. Multilevel inheritance
D. None of the above
Select an option to see the answer and solution.
In C++, which type of inheritance allows a class to inherit from multiple classes directly or indirectly?
A. Multilevel inheritance
B. Hierarchical inheritance
C. Multiple inheritance
D. Single inheritance
Select an option to see the answer and solution.
What is the process of defining a new class by extending an existing class in C++?
A. Base class
B. Inherited class
C. Subclass
D. Derived class
Select an option to see the answer and solution.
In C++, which access specifier allows the members of a base class to be accessible in the derived class as well as from outside the class?
A. public
B. private
C. protected
D. friend
Select an option to see the answer and solution.
What is the term used to describe a derived class having more than one base class in C++?
A. Multilevel inheritance
B. Hierarchical inheritance
C. Single inheritance
D. Multiple inheritance
Select an option to see the answer and solution.
In C++, what is the process of creating a new class from an existing class known as?
A. Composition
B. Encapsulation
C. Inheritance
D. Polymorphism
Select an option to see the answer and solution.
Which keyword is used to denote the access specifier in a derived class when inheriting from a base class in C++?
A. using
B. inherits
C. extends
D. : protected
Select an option to see the answer and solution.
In C++, which type of inheritance involves inheriting from multiple base classes, but only inheriting one level deep from each base class?
A. Hierarchical inheritance
B. Multilevel inheritance
C. Single inheritance
D. None of the above
Select an option to see the answer and solution.