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

Can you explain the final method modifier?

0 Answers  


How the elements are organized in GridLayout?

2 Answers  


What is codebase?

0 Answers  


How to store image in arraylist in java?

0 Answers  


What are the differences between include directive and include action?

0 Answers  






What is %02d?

0 Answers  


Explain enumeration in java?

0 Answers  


when to use ArrayList and when to use HashMap in webApplication.

1 Answers  


Why do we use bufferedreader?

0 Answers  


What are the advantages of defining packages in java?

0 Answers  


What does next mean in java?

0 Answers  


What is meant by constructor?

8 Answers  


Categories