if a class member has a private modifier, it is not allowed to access the class member outside of the class scope. When you apply the private modifier to a class constructor, the outer class is prevented from creating an instance of the class. Although it seems a bit difficult to understand (since it cannot be instantiated, what is the use of this class?), but in fact this is a very powerful feature.
Most obviously, a private constructor is often used if a class only provides functionality through static methods and fields. the System.Math class in the Framework class library FCL is a classic example.
The System.Math class has two static fields: Pi and E (natural logarithm base), and some methods for returning trigonometric values. These methods are used as built-in functions, so it is not necessary for the program to create an instance of the math class for using these fields and methods.
It may be natural to have a question like this: Do you want to avoid instantiation, use a private constructor, or use an abstract class? The answer is to understand the difference. first, consider inheritance, although an abstract class cannot be instantiated, but its true purpose is to be used as a base class so that derived classes (which can be instantiated) create their own implementations. Classes that use private constructors are not inherited and cannot be inherited. Second, a private constructor can only prohibit an external class from instantiating the class, but it cannot prohibit the creation of instances within that class.
the properties of private constructors can also be used to manage the creation of objects. Although the private constructor does not allow external methods to instantiate this class, it allows public methods (sometimes called factory methods, factory method) in this class to create objects. In other words, a class can create its own instance, control access to it, and control the number of instances created
Note: This article is from 51cto.com
C # Foundation--Private constructor function in class