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

Answer Posted / sadiq

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

Is This Answer Correct ?    30 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a boolean flag in java?

559


How to stop a thread in java? Explain about sleep () method in a thread?

580


Does google use java?

531


What string is utf8?

543


What are class members by default?

656






How do you sort arrays in java?

522


What are the differences between stringbuffer and stringbuilder?

536


What is default exception handling in java?

568


Can a class have multiple constructors?

531


Why 1 is not a prime number?

551


What is the abstract class?

595


how to create multithreaded program? : Java thread

501


Differentiate between stringbuffer and stringbuilder in java.

550


How do singleton patterns work?

513


What is unmodifiable collection in java?

507