Object-Oriented Programming MCQs (Part-9)

What does Object Serialization do in OOP?

A Manages memory
B Converts object to file
C Validates object data
D Inherits object data

Which of the following is a key benefit of Object Serialization?

A Data persistence
B Code optimization
C Dynamic binding
D Method overriding

Which of the following SOLID principles focuses on reducing the impact of changes in a class?

A Interface Segregation Principle
B Single Responsibility Principle
C Open/Closed Principle
D Liskov Substitution Principle

Which SOLID principle emphasizes that a class should have only one reason to change?

A Liskov Substitution Principle
B Dependency Inversion Principle
C Single Responsibility Principle
D Interface Segregation Principle

What does UML (Unified Modeling Language) primarily help to do in OOP?

A Handle runtime exceptions
B Visualize system architecture
C Create dynamic behavior
D Define class attributes

Which UML diagram is used to represent the structure of classes and their relationships?

A Sequence diagram
B Activity diagram
C Class diagram
D Use case diagram

What is the purpose of Method Overriding in OOP?

A To change inherited methods
B To reduce code complexity
C To create new methods
D To optimize method calls

Which of the following is an example of Polymorphism in OOP?

A Data encapsulation
B Method Overloading
C Object serialization
D Inheritance

Which SOLID principle ensures that clients should not be forced to depend on interfaces they do not use?

A Single Responsibility Principle
B Open/Closed Principle
C Interface Segregation Principle
D Dependency Inversion Principle

In UML, which diagram helps to depict the dynamic flow of a system through interaction between objects?

A State diagram
B Sequence diagram
C Class diagram
D Use case diagram

Which of the following principles states that a subclass must be substitutable for its superclass?

A Liskov Substitution Principle
B Single Responsibility Principle
C Interface Segregation Principle
D Dependency Inversion Principle

Which UML diagram helps in understanding user interactions with a system?

A Component diagram
B State diagram
C Activity diagram
D Use case diagram

Which of the following is NOT a benefit of applying SOLID principles in OOP?

A Code flexibility
B Code maintainability
C Increased complexity
D Easier debugging

In UML, which diagram is used to show the flow of activities and actions in a system?

A Class diagram
B Sequence diagram
C Use case diagram
D Activity diagram

What is the main role of Object Serialization in distributed systems?

A Execute remote calls
B Convert object to byte stream
C Compress data
D Store data in files