what is the use of declaring constructor as private?

Answer Posted / suganya

prevent to access by other class even sub class cant have
permission to create object of that base class.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the important features of Java 8 release?

581


Why java is platform independent? Explain.

602


What is the symbol for average?

521


Highest level event class of the event-delegation model?

3506


What are the advantages of encapsulation in java?

556






What are the two environment variables that must be set in order to run any java programs?

533


Do I need java on my computer?

528


What variables are stored in stack?

532


Where is const variable stored?

537


When can we say that threads are not lightweight process in java?

597


How is the marker interface used in Java?

613


Explain about the dynamic behavior of core java?

637


Why are lists ordered in java?

550


What happens if constructor is private?

566


Is constructor inherited?

535