Which of the following are true for the singleton class?
A. Singleton classes should be used whenever it is important that only a single instance of a class exist and that that single instance be widely accessible
B. The Singleton pattern can also be used, with slight modifications, when a limited number of instances greater than one are desired
C. Access restrictions are usually easy to add by restricting the visibility of either the class or the factory method
D. All of the mentioned
Answer:A
Which of the following are true for the singleton class?
A. Singleton classes should be used whenever it is important that only a single instance of a class exist and that that single instance be widely accessible B. The Singleton pattern can also be used, with slight modifications, when a limited number of instances greater than one are desired C. Access restrictions are usually easy to add by restricting the visibility of either the class or the factory method D. All of the mentioned
Explanation: All the mentioned re true for the singleton class.