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 we create constructor in abstract class ?
What are the characteristics provided in jdk1.6 apart from other versions?
What is difference between checked and unchecked exception in java?
What is a native method?
Why Java is a platform independent language?
What is locale?
Explain the relationship between the Canvas and Graphics class?
What must a class do to implement an interface in java programming?
What is the difference between assignment and initialization?
Will set allow duplicates in java?
Is boolean a wrapper class in java?
Explain different ways of creating a thread?