How many objects are created for a singleton class
Answer Posted / sivadasan
Singleton class allows to create only one instance of the
class. But the other objects can inherit from it. Singleton
is a Design Pattern to restrict create more than one
instance of a class.
And
1. It ensures only one object created for a class
2. Provides global point of access.
Mostly it is used to create DB connections.
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
How do generics work?
Can we declare register variable as global?
How objects of a class are created if no constructor is defined in the class?
What is the difference between && and & in java?
Explain the term virtual machine?
What is the purpose of extern variable?
How to do encapsulation in java?
What is methods and methodology?
What is remote method invocation (rmi)?
What are the differences between this and super keyword?
What is difference between filereader and bufferedreader?
What is percentage in java?
Explain what is Marker interface?
What is the use of inner class?
What is the purpose of object oriented programming?