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 the difference between variable declaration and variable initialization?
What data type is a string?
Will the jvm load the package twice at runtime?
What is the difference between static and global variables and also define what are volatile variables?
0 Answers Flextronics, Hexaware,
How do you compare arrays in java?
What is meant by tab pans?
What is prime number in java?
Convert a binary search tree to a sorted doubly linked list inplace.
explain the clone method and clonable interface
What is a singleton factory?
How do you ensure that n threads can access n resources without deadlock?
can rmi and corba based applications interact ?