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 |
Does anyone still use java?
What are the two ways to create a thread?
How many types of parsers are there?
Difference between arraylist and vector.
how to use crystal reports in java
in a console we r giving java <class name> if r pressing enter where it'll goes
What is assembly language?
Explain scope or life time of local variables in java?
What are the 6 mandatory procedures for iso 9001?
What is an immutable class? How to create an immutable class?
What are the steps to do connection pooling in weblogic?
How many JVMs can run on a single machine and what is the Just-In-Time(JIT) compiler?