30 Basic and Core MCQs On OOP
30 Basic and Core MCQs On OOP
Basic Concepts
Inheritance
11. Which type of inheritance involves a single class being inherited by multiple classes?
o a) Single inheritance
o b) Multiple inheritance
o c) Multilevel inheritance
o d) Hierarchical inheritance
12. What is the correct syntax for creating a derived class in C++?
o a) class Derived : public Base
o b) class Base : Derived
o c) class Derived -> Base
o d) class Base = Derived
13. Which access specifier restricts access to the class members to the derived class
only?
o a) Public
o b) Private
o c) Protected
o d) Internal
14. Which of the following is true about multiple inheritance?
o a) A class can inherit from multiple classes
o b) It is not allowed in C++
o c) It is not allowed in Python
o d) A class can inherit from only one class
15. What is the order of constructor calls in multilevel inheritance?
o a) Derived class first, then base class
o b) Base class first, then derived class
o c) It depends on the programming language
o d) Simultaneous for both classes
Polymorphism
Advanced Concepts
Miscellaneous
These questions cover a wide range of OOP concepts and should be helpful for your
comprehensive exam preparation.
4o
mentions ansewers also
ChatGPT
Here are the 30 basic and core MCQs on Object-Oriented Programming (OOP) along with their
answers:
Basic Concepts
Inheritance
11. Which type of inheritance involves a single class being inherited by multiple classes?
o a) Single inheritance
o b) Multiple inheritance
o c) Multilevel inheritance
o d) Hierarchical inheritance
12. What is the correct syntax for creating a derived class in C++?
o a) class Derived : public Base
o b) class Base : Derived
o c) class Derived -> Base
o d) class Base = Derived
13. Which access specifier restricts access to the class members to the derived class
only?
o a) Public
o b) Private
o c) Protected
o d) Internal
14. Which of the following is true about multiple inheritance?
o a) A class can inherit from multiple classes
o b) It is not allowed in C++
o c) It is not allowed in Python
o d) A class can inherit from only one class
15. What is the order of constructor calls in multilevel inheritance?
o a) Derived class first, then base class
o b) Base class first, then derived class
o c) It depends on the programming language
o d) Simultaneous for both classes
Polymorphism
Advanced Concepts
Miscellaneous