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 private protected in java?
What is method and methodology?
Where to store local variables?
What does arrays sort do in java?
What is keyword and identifier?
What is java in detail?
What is string [] java?
Is finalize() similar to a destructor?
Difference between static synchronization vs. Instance synchronization?
What is a map? What are the implementations of map?
What are the two parts of a conditional statement?
Given a singly linked list, how will you print out its contents in the reverse order? Can you do it with consuming any extra space?
What are the default and parameterized constructors?
What are void methods?
What is formatted output in java?