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
What is object cloning in Java?
Does hashset allow duplicates in java?
What do you understand by the term wrapper classes?
What is difference between public static and void?
FOR EXAMPLE WE R HAVING TWO LIST ELEMENTS ..BOTH LISTS CONTAINS ID,NAME,PLACE ..I NEED TO COMPARE BOTH IDS IN TWO LISTS,IF ID'S R SAME MEANS WE HAVE ADD THE DETAILS(LIKE NAME,PLACE) TO MAP...HOW IS POSSIBLE ?CAN ANY ONE SUGGEST?
What is difference between array and arraylist in java?
what are three ways in which a thread can enter the waiting state? Or what are different ways in which a thread can enter the waiting state? : Java thread
Can a hashset contain duplicates java?
Can we pass null as argument in java?
Does java support Operator Overloading?
Which software is used for java programming?
Which programming language is most secure?
Is set thread safe java?
What languages are pass by reference?
What is the difference between state-based unit testing and interaction-based unit testing?