| 6. |
A developer needs a class that manages a shared print spooler. Only one spooler should ever exist in the application, and any part of the application must be able to retrieve it without holding a direct reference. Which aspect of the Singleton pattern satisfies both requirements?
Please select the correct answer:
|
| |
A.
|
The private constructor prevents instantiation, and the public static getInstance() method provides the shared access point. |
| |
B.
|
The abstract getInstance() method forces subclasses to implement their own spooler. |
| |
C.
|
The Singleton pattern delegates spooler creation to a separate Factory class. |
| |
D.
|
The Singleton pattern uses interface inheritance to ensure only one spooler type exists at runtime. |