Where and how can you use a private constructor in java?
Ask by Sumit Kesarwani
Updated 15 Sep 2020
Private constructor is used if you do not want other classes to instantiate the object and to prevent sub-classing. The instantiate is done by a public static method (i.e. a static factory method) within the same class.