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 java reflection api?
What is difference between equals and hashcode method?
What is a jit compiler?
What is finalize()? Is finalize() similar to a destructor?
What is hashing in java?
What is super constructor?
What is a function in java?
How do you differentiate abstract class from interface?
there are N number of matchboxes numbered 1...N.each matchbox contain various number of stick.Two player can alternatevely pick some amount of stick from the higest stick containing box . The player is condidered win if there is no stick after his move.Find the final move so that the move player win. Note:In case the number of stick is equal ,pick the stick from the higest numbered box.
What is an exception in java?
what is anonymous class in java?
Why can't we make a class private in java?
What is the difference between char and char *?
Why heap memory is called heap?
How do you declare a variable?