what is the use of declaring constructor as private?

Answer Posted / ravikiran

In order to restrict the class to get subclassed

Is This Answer Correct ?    6 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How is hashset defined in java?

517


Explain java thread life cycle.

576


Is space a character in java?

508


Difference between association, composition and aggregation?

553


What is ‘has a’’ relationship in java?

720






Explain the differences between abstraction and encapsulation?

512


Explain the term virtual machine?

583


What is a variable and constant?

541


Differentiate between == and equals().

587


Explain java heap space and garbage collection?

576


What is a function easy definition?

522


What does java ide mean?

631


What is a loop java?

582


Distinguish between a predicate and a function?

561


What is file in java?

551