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
Why arraylist is used in java?
Explain all java features with real time examples
What is the do while loop syntax?
How do you start a new line in java?
What does s mean in regex?
What exactly is java?
What is ternary operator in java?
How does hashmap work in java ?
How do you override a method in java?
What is string pool?
What is a cup of java?
What are the benefits of java?
What is a jagged array in java?
What is the difference between abstract class and interface1? What is an interface?
Does sprintf add a null terminator?