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

why are wait(), notify() and notifyall() methods defined in the object class? : Java thread

749


Can singleton class be cloned?

800


What exactly is a .class file?

815


State some advantages of java?

985


What does jre stand for?

811


What is return null in java?

712


Define linked list and its features with signature?

769


Which collection is thread safe in java?

742


What is the java project architecture?

1998


Difference between abstract and concrete class ?

772


there are N number of matchboxes numbered 1...N.each matchbox contain various number of stick.Two player can alternatevely pick some amount of stick from the higest stick containing box . The player is condidered win if there is no stick after his move.Find the final move so that the move player win. Note:In case the number of stick is equal ,pick the stick from the higest numbered box.

1776


What is unsigned char?

843


What is main method?

774


Why pass by reference is not possible in java?

718


Which is easier .net or java?

846