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
Detail discussions on JVM, memory management and garbage collector.
What are the states of thread in java?
Why should we use singleton pattern instead of static class?
Why is sizeof not a function?
What are the differences between throw and throws?
What are the common uses of "this" keyword in java ?
How do you invoke a method?
What is a predicate method?
What does escaping a character mean?
What is printwriter in java?
What is a vararg?
What is an example of a keyword?
How many techniques can be employed to create a string object?
What is string builder?
What is a parameter example?