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 unsigned char?
If two threads have same priority which thread will be executed first ?
What is the purpose of javac exe?
What happens when you add a double value to a string?
Why deletion in linkedlist is fast than arraylist?
How do you write a scanner class in java?
What is the purpose of void?
how can you take care of mutual exclusion using java threads? : Java thread
Is java a software?
Is it possible to compare various strings with the help of == operator?
Can private method static?
What is numeric function?
Is alive method in java?
What is difference between equals and hashcode method?
Can we clone singleton class in java?