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
Difference between object instantiation and construction ?
How do you remove an object from an arraylist in java?
What is the covariant return type?
Can we use String with switch case?
Is binary a low level language?
What are identifiers in java?
What are the steps involved to create a bean?
Explain listiterator and methods in listiterator?
how to convert Java project into Maven ?
What is instance example?
What is the difference between the jdk 1.02 event model and the event-delegation model introduced with jdk 1.1?
What is t in generics in java?
How many bytes is a char in java?
What is meant by polymorphism?
Is java free for commercial?