Question
1.Which of the following are critical to fix the class below which is claimed to use the Singleton pattern? Check all that apply The constructor
1.Which of the following are critical to fix the class below which is claimed to use the Singleton pattern?
Check all that apply
The constructor Singleton( ) should be static
The constructor Singleton( ) should be private
The getInstance( ) should be static
The getInstance( ) should be public
2.The interfaces Serializable and Cloneable in Java are empty (no operations declared), while the interface Runnable declares one operation run( ). Which one is correct?
They are all Marker interfaces. | |
Two of them are not Marker interfaces. |
One of them is not a Marker interface. |
None of them is a Marker interface. |
3.Many clients compete for a limited number of objects created from a ServiceProvider class to do their jobs. A proposal is to have one Manager object take full charge of all service requests from clients. Which design pattern is less likely to be used?
Object Pool | |
Marker | |
Singleton |
Delegation |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started