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

When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?

1289


Can constructor return value?

1010


what is interface in java? Explain

1032


Can you override static methods?

1049


How many types of equations are there?

1064


What does isempty () do in java?

1115


How do you sort a string in alphabetical order in java?

966


what is the messsage u r going to get from an objectoriented programing?

2149


Define "Access specifiers" in java.

1214


What is t type java?

1101


How do you control extraneous variables?

965


What is the purpose of a parameter?

1135


What does the ‘static’ keyword mean? Is it possible to override private or static method in java?

1032


What are variable arguments or varargs?

1063


What is a functional interface?

1090