Hi,
What is the use of Private Constructor in Java ?
Private Constructor in Java
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Oct 20, 2011, 9:40 AM EDT
Private constructor can be used if we do not want any other class to instantiate the class. This concept is generally used in Singleton Design Pattern.For details refer the below link
http://www.javapractices.com/topic/TopicAction.do?Id=40
Thanks
VulpesRank #55 · 29.2K reputationPosted Oct 20, 2011, 9:40 AM EDT
AartiRank #2,383 · 594 reputationPosted Nov 16, 2011, 11:08 PM EST