Styrow.dev
Question 74 of 247
Java Topic: General medium

Where and how can you use a private constructor?

Question

Where and how can you use a private constructor?

Answer

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