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.
Liked By
Write Answer
Where and how can you use a private constructor in java?
Join MindStick Community
You have need login or register for voting of answers or question.
Sumit Kesarwani
10-Apr-2014Private 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.