How to prevent to create multiple objects of a java class?
Answer Posted / sadiq
Using Singleton Design pattern we can prevent class creating
multiple objects.
| Is This Answer Correct ? | 30 Yes | 3 No |
Post New Answer View All Answers
What are JVM.JRE, J2EE, JNI?
Which class contains a method: cloneable or object?
What is the largest long allowed by java?
How can an object be unreferenced?
What is a singleton class in Java?
What is class and object in java?
What is main difference between variable and constant?
Is this valid in java ? Can we instantiate interface in java?
How to provide security in java
When should we create our own custom exception classes?
Is singleton class thread safe?
Explain the difference between throw and throws in java?
Is set ordered?
What is the difference between Java and C++?
What’s meant by anonymous class?