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

is it possible to instantiate the math class?

522


What are void methods?

561


how its run?

559


Explain how hashmap works?

586


Can we use a default constructor of a class even if an explicit constructor is defined?

643






What is udp in java?

528


What is super?

577


Can substring create new object?

553


How can we make string upper case or lower case?

593


What is meant by class?

535


What is the memory leak in java?

520


What is an interface in java? Explain

567


How to create an interface?

623


Can we have more than one package statement in source file ?

580


What are the different types of collections in java?

523