Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to implement Singleton

Answer Posted / supraja

The Singleton pattern
In Design Patterns, the authors describe the Singleton
pattern like this:

Ensure a class has only one instance, and provide a global
point of access to it.



The figure below illustrates the Singleton design pattern
class diagram.



Singleton class diagram

As you can see from the figure above, there's not a whole
lot to the Singleton design pattern. Singletons maintain a
static reference to the sole singleton instance and return
a reference to that instance from a static instance()
method.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the uses of java?

1024


What do bitwise operators do?

952


What is independent and dependent variables in research?

810


What is the use of predicate in java 8?

891


Is double bigger than float?

912


Is list ordered in java?

921


Write a program to print count of empty strings in java 8?

937


What is a finally block?

926


What is the list interface?

1039


How can we achieve thread safety in java?

1085


Is alive method in java?

917


What is better- service oriented or batch oriented solutions?

2145


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

1284


What is volatile data type?

949


Can we synchronize static methods in java?

1039