How to prevent to create multiple objects of a java class?

Answers were Sorted based on User's Feedback



How to prevent to create multiple objects of a java class?..

Answer / sadiq

Using Singleton Design pattern we can prevent class creating
multiple objects.

Is This Answer Correct ?    30 Yes 3 No

How to prevent to create multiple objects of a java class?..

Answer / naseer

declare constructor as private .that class only create one object

Is This Answer Correct ?    10 Yes 6 No

How to prevent to create multiple objects of a java class?..

Answer / zoozoo

use collections

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More Core Java Interview Questions

What is composition in java?

0 Answers  


What is the difference between a vector & an array list?

0 Answers   Agilent,


What happens when you assigned a 'double' value to a 'String'?

8 Answers  


Why scanner is used in java?

0 Answers  


Explain cookies?

2 Answers   Canon,






Is singleton a bad practice?

0 Answers  


Is alive method in java?

0 Answers  


Explain 5 io best practices?

0 Answers  


Is string a data type in java?

0 Answers  


How do you set security in applets?

1 Answers   Wipro,


what is difference between signed & unsigned char?

2 Answers  


What is string substring?

0 Answers  


Categories