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 the uses of java?
What do bitwise operators do?
What is independent and dependent variables in research?
What is the use of predicate in java 8?
Is double bigger than float?
Is list ordered in java?
Write a program to print count of empty strings in java 8?
What is a finally block?
What is the list interface?
How can we achieve thread safety in java?
Is alive method in java?
What is better- service oriented or batch oriented solutions?
Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)
What is volatile data type?
Can we synchronize static methods in java?