what is private constructor?what are the uses of writing
private constructor in our program?

Answer Posted / amit

Private constructor can be used to make a pure static
class, using it we can create only one instance of class at
the loading time.

Is This Answer Correct ?    1 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is string manipulation?

501


What is difference between this and super keyword?

521


What is class variable java?

587


explain what is transient variable in java?

630


What is the difference between yielding and sleeping in java programming?

588






Explain java thread life cycle.

583


What is a condition in java?

540


What are exceptions

646


How many bits is a string?

527


How can you make sure that your singleton class will always return single instance in multi-threaded environment?

576


In how many ways we can create threads in java?

635


We are seeing so many videos/audios as many web sited. But question is these videos or audios are stored in Databases ( Oracle, Mysql, Sybase,... ) or stored any file directory from there they will give the link for that? Pls explain and give sample code to achieve this one? Thanks, Seenu.

1493


Which is dependent variable?

498


What is an error in java?

642


Define how can we find the actual size of an object on the heap?

663