what is the use of private constructor in core java?
Answer Posted / deep chandra harbola
private constructor are used to create Sinleton class.
example logger class
for singleton class only one object can be created.
by default member of singleton class are static.
singleton class can not be inherited.
| Is This Answer Correct ? | 29 Yes | 3 No |
Post New Answer View All Answers
What is byte data type?
What is java virtual machine and how it is considered in context of java’s platform independent feature?
How many types of interfaces are there?
Is void a type?
Why do we need hashmap in java?
What is a subsequence of a string?
How do you override a private method in java?
How are variables stored?
What does sizeof return?
Why we used vector class?
Why arraylist is not synchronized in java example?
Explain oops concepts in detail?
Can we assign null to double in java?
Why we used break and continue statement in java?
What is a map? What are the implementations of map?