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 |
Can you explain the final method modifier?
How the elements are organized in GridLayout?
What is codebase?
How to store image in arraylist in java?
What are the differences between include directive and include action?
What is %02d?
Explain enumeration in java?
when to use ArrayList and when to use HashMap in webApplication.
Why do we use bufferedreader?
What are the advantages of defining packages in java?
What does next mean in java?
What is meant by constructor?