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 are constructors in java?
What was java originally called?
What is the difference between logical data independence and physical data independence?
what is a green thread? : Java thread
What are variable arguments or varargs?
Is void a type?
What are different types of inner classes ?
How do I find and replace in word?
Explain about arraylist?
How many bytes is a string?
What is local variable and instance variable?
What is static keyword?
What is the difference between yield() and sleep()?
How do you add an element to a hashset in java?
How do you define a set in java?