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
When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?
Can constructor return value?
what is interface in java? Explain
Can you override static methods?
How many types of equations are there?
What does isempty () do in java?
How do you sort a string in alphabetical order in java?
what is the messsage u r going to get from an objectoriented programing?
Define "Access specifiers" in java.
What is t type java?
How do you control extraneous variables?
What is the purpose of a parameter?
What does the ‘static’ keyword mean? Is it possible to override private or static method in java?
What are variable arguments or varargs?
What is a functional interface?