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 are abstract classes and anonymous classes?

630


What is return null in java?

502


What package is math in java?

526


Why does java does not support multiple inheritance? Explain

539


What is run time allocation?

568






What is the full meaning of java?

525


Explain the difference between the public, private, final, protected, and default modifiers?

547


Define jit compiler?

649


What is linked hashmap and its features?

531


What is array list in java?

582


What is volatile data type?

542


What happens to a static var that is defined within a method of a class?

543


Can a static method be overridden in java?

554


What is the basic concept of java?

526


What is the size of a string in java?

536