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 the best way to findout the time/memory consuming process?
How do you sort in java?
What is a null point?
Why is the type for real numbers called double?
What is the difference between a factory and abstract factory pattern?
What is class array in java?
What is the purpose of declaring a variable as final?
how many types of Inheritance?
What is byte code and why is it important to java’s use for internet programming?
Which sort is best in java?
Can a list be null in java?
Is set ordered?
Write a method that will remove given character from the string?
What do you mean by order of precedence and associativity?
What is natural ordering in java?