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


Please Help Members By Posting Answers For Below Questions

Difference between object instantiation and construction ?

582


How do you remove an object from an arraylist in java?

467


What is the covariant return type?

580


Can we use String with switch case?

669


Is binary a low level language?

513






What are identifiers in java?

577


What are the steps involved to create a bean?

685


Explain listiterator and methods in listiterator?

549


how to convert Java project into Maven ?

585


What is instance example?

525


What is the difference between the jdk 1.02 event model and the event-delegation model introduced with jdk 1.1?

619


What is t in generics in java?

563


How many bytes is a char in java?

533


What is meant by polymorphism?

541


Is java free for commercial?

491