Why do Private Constructors exist? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 7

Why do Private Constructors exist?

Just recently, I learned that a constructor can be private. My question is; what's d point?

17th Sep 2017, 6:24 PM
David Akhihiero
David Akhihiero - avatar
2 Respuestas
+ 11
Search for Singleton pattern.
17th Sep 2017, 6:29 PM
Tashi N
Tashi N - avatar
+ 8
Thanks all 😊
17th Sep 2017, 6:48 PM
David Akhihiero
David Akhihiero - avatar