Object-Oriented Programming MCQs (Part-4)

What is a Class in OOP?

A Method container
B Object template
C Instance generator
D Data holder

Which of the following cannot be used to instantiate a Abstract Class?

A Constructor
B Inheritance
C Direct instantiation
D Object cloning

What is the purpose of a Destructor in OOP?

A Allocate memory
B Initialize object state
C Handle errors
D Destroy object

Which access modifier provides the highest level of access in OOP?

A Public
B Default
C Protected
D Private

What is the default access modifier for a class member in Java if none is specified?

A Private
B Public
C Protected
D Package-private

What does a Constructor do when an object is created in OOP?

A Defines class properties
B Initializes object
C Executes first
D Returns object reference

What is the main advantage of Method Overloading in OOP?

A Reduces errors
B Increases performance
C Increases flexibility
D Simplifies inheritance

Which of the following is a characteristic of Object-Oriented Programming?

A Focuses on objects
B Does not allow classes
C Uses only functions
D Functions as data

Which of the following is NOT an example of an Access Modifier?

A Default
B Public
C Private
D Static

What is the key difference between Static Binding and Dynamic Binding in OOP?

A Object vs class
B Memory management vs coding style
C Compile-time vs runtime
D Method overloading vs overriding

Which of the following allows a class to inherit only from one parent class in OOP?

A Polymorphism
B Multiple inheritance
C Single inheritance
D Interface

Which OOP principle is best described by “a class should have only one reason to change”?

A Single Responsibility
B Dependency Inversion
C Abstraction
D Encapsulation

What is an example of a method that is often used in OOP for error handling?

A Main method
B Catch method
C Constructor method
D Run method

Which design pattern ensures that a class has only one instance?

A Observer
B Strategy
C Singleton
D Factory

Which concept in OOP refers to objects interacting with each other through method calls?

A Message Passing
B Polymorphism
C Inheritance
D Encapsulation