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
Do I need java on my computer?
Explain constructors and types of constructors in java.
What is r * in math?
What do you mean by platform independence?
What are basic data types?
Can finally block be used without a catch?
What is method and methodology?
What is a memory leak in java?
In the below example, what will be the output?
What is the use of string and stringbuffer?
How to set the permissions to a file in java?
Is java hard to learn?
Why a dead thread occurs?
How would you use Bubble Sort to sort the number of elements?
what is thread? : Java thread