CDAC OOPs MCQs (Object-Oriented Programming - 50 Questions)
1. Which of the following is not a feature of OOP?
a) Encapsulation b) Inheritance c) Compilation d) Polymorphism
2. Which feature of OOP describes reusability?
a) Inheritance b) Polymorphism c) Abstraction d) Encapsulation
3. What is used to hide internal implementation details?
a) Inheritance b) Abstraction c) Encapsulation d) Polymorphism
4. Which OOP concept binds data and functions together?
a) Inheritance b) Encapsulation c) Abstraction d) Overloading
5. Which of the following allows function overloading?
a) Same name, different parameters b) Same parameters c) Different names d) None
6. Which keyword is used to inherit a class in C++?
a) this b) base c) public d) extends
7. What is polymorphism?
a) Many forms of a function or method b) Single form only c) Code duplication d) Object cloning
8. Overloading and Overriding are types of:
a) Inheritance b) Polymorphism c) Encapsulation d) Data hiding
9. Which of the following supports dynamic polymorphism?
a) Virtual functions b) Static functions c) Constructors d) Inline functions
10. Which language is not fully object-oriented?
a) Java b) Python c) C++ d) C
11. What is the output of:
class A { public: void show() { cout << 'A'; } };
class B: public A { public: void show() { cout << 'B'; } };
A *obj = new B(); obj->show();
a) A b) B c) Compilation error d) A (if show not virtual)
12. Which access modifier restricts access to the class itself?
a) public b) private c) protected d) static
13. In Java, all classes by default inherit from:
a) BaseClass b) Object c) Root d) System
14. Constructor overloading means:
a) More than one constructor in a class b) Overriding constructor c) Inheriting constructor d) Static constructor
15. Destructor is used for:
a) Creating objects b) Copying objects c) Deleting objects d) Overriding objects
16. Which of these is not a pillar of OOP?
a) Encapsulation b) Inheritance c) Compilation d) Polymorphism
17. Abstraction is:
a) Showing only essential features b) Hiding everything c) Binding code d) Memory allocation
18. Which keyword is used to prevent inheritance?
a) final b) static c) const d) virtual
19. Which method is called when an object is created?
a) Destructor b) Constructor c) Copy Constructor d) Virtual method
20. Which is used to call the base class constructor?
a) super b) base c) parent d) this