Type Here to Get Search Results !

Which of the following is an example of a design pattern in OOP?

0

 Which of the following is an example of a design pattern in OOP?

A) Inheritance
B) Polymorphism
C) Observer
D) Encapsulation

Answer: C) Observer

Explanation: The Observer pattern is a behavioral design pattern that defines a one-to-many dependency between objects. When one object (the subject) changes its state, all dependent observers are notified and updated automatically. This pattern is widely used for implementing distributed event-handling systems.

Post a Comment

0 Comments