Private constructors are used to prevent creating instances of a class when there are no instance fields or methods , such as the Math class, or when a method is called to obtain an instance of a class. If all the methods in the class are static, consider making the complete class static.
Read moreCan you make a constructor private?
Yes, we can declare a constructor as private . If we declare a constructor as private we are not able to create an object of a class. We can use this private constructor in the Singleton Design Pattern.
Read moreCan you have a private constructor C#?
Private Constructor is a special instance constructor present in C# language . Basically, private constructors are used in class that contains only static members. The private constructor is always declared by using a private keyword.23 Oca 2019
Read more