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

Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)

857


What is method in java with example?

493


How dead lock situation occurs in java and how you can identify it?

547


What is private public protected in java?

572


What are the types of sockets in java?

543






What are the differences between forwarding () method and sendredirect() methods?

624


What is tree node in java?

530


Why main function is static?

675


What is collection sort in java?

559


Which software is used for java programming?

561


Why is singleton not thread safe?

654


Does .length start 0 java?

569


Write a program to show whether a graph is a tree or not using adjacency matrix.

599


Is arraylist an object in java?

603


What is the difference between static and non-static variables in java programming?

523