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
What happens when a thread cannot acquire a lock on an object in java programming?
How to create a fecelet view?
Explain thread in java?
Can we access instance variables within static methods ?
How do you use find and replace?
What is the default value of byte datatype in java?
If a class is declared without any access modifiers, where may the class be accessed in java programming?
What is class level lock ?
What is the difference between a constructor and a method?
Give the difference between the println method and sqrt method?
Why is string builder not thread safe?
is there a separate stack for each thread in java? : Java thread
Are there structures in java?
What is the indent key?
What is the best definition for data?