How to prevent to create multiple objects of a java class?
Answers were Sorted based on User's Feedback
Answer / sadiq
Using Singleton Design pattern we can prevent class creating
multiple objects.
Is This Answer Correct ? | 30 Yes | 3 No |
Answer / naseer
declare constructor as private .that class only create one object
Is This Answer Correct ? | 10 Yes | 6 No |
What is composition in java?
What is the difference between a vector & an array list?
What happens when you assigned a 'double' value to a 'String'?
Why scanner is used in java?
Explain cookies?
Is singleton a bad practice?
Is alive method in java?
Explain 5 io best practices?
Is string a data type in java?
How do you set security in applets?
what is difference between signed & unsigned char?
What is string substring?