Inheritance and Abstraction in C++

1. What is inheritance in C++?
A) A way to hide implementation details
B) A way to reuse code and create a new class from an existing class.
C) A way to create objects.
D) A way to perform mathematical calculations.
2. Which keyword is used to implement inheritance in C++?
A) extend
B) base
C) class
D)B) inherit
3. Which C++ keyword is used to indicate that a class derives from another class?
A) public
B) private
C) protected
D) access
4. Which C++ feature is used to achieve abstraction?
A) Inheritance
B) Encapsulation
C) Polymorphism
D) Composition
5. Which type of inheritance involves a class having multiple base classes?
A) Hierarchical inheritance
B) Single inheritance
C) Multiple inheritance
D) Multilevel inheritance
6. What is an abstract class in C++?
A) A class that cannot have any member functions.
B) A class that cannot be instantiated and serves as a base for other classes.
C) A class that is hidden from the rest of the program.
D) A class that only contains private members.
7. In C++, if a derived class defines a method that is already defined in the base class, what is this called?
A) Function hiding
B) Function overriding
C) Function overloading
D) Function inheriting
8.What is function overloading in C++?
A) Using functions to perform complex calculations.
B) Defining multiple functions with the same name but different parameters.
C) Creating functions that are inaccessible from outside the class.
D) Converting functions into inline functions.
9.Which access specifier is used to make members accessible only within the same class?
A) public
B) protected
C) private
D) internal
10. In C++, a class that is derived from another class is called a:
A) Base class
B) Derived class
C) Parent class
D) Child class
{"name":"Inheritance and Abstraction in C++", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"1. What is inheritance in C++?, 2. Which keyword is used to implement inheritance in C++?, 3. Which C++ keyword is used to indicate that a class derives from another class?","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Powered by: Quiz Maker