Where and how can you use a private constructor?

Short Answer
Views 542

Answer:

Private constructor is used if you do not want other classes to instantiate the object and to prevent subclassing.

Related Articles:

This section is dedicated exclusively to Questions & Answers. For an in-depth exploration of Java Programming Language, click the links and dive deeper into this subject.

Join Our telegram group to ask Questions

Click below button to join our groups.