Object-Oriented Programming (OOP)
Choose the correct description of Singleton pattern.
- A. The process by which objects communicate with one another by invoking each other's methods.
- B. A design pattern that restricts the instantiation of a class to a single shared object. ✓
- C. A mechanism where the method to be executed is determined at runtime rather than at compile time.
- D. A keyword that controls the visibility and accessibility of a class's members, such as public or private.
Correct answer
B. A design pattern that restricts the instantiation of a class to a single shared object.
Explanation
Singleton pattern refers to a design pattern that restricts the instantiation of a class to a single shared object.