Private Constructor
Private constructors are used to prevent the creation of 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
Private Constructor example

Notice that if you uncomment the following statement from the example, it will generate an error because the constructor is inaccessible because of its protection level.

Constructors can be marked as public, private, protected, internal, protected internal or private protected.
Private Protected
The private protected access modifier is valid in C# version 7.2 and later.
Example
A private protected member of a base class is accessible from derived types in its containing assembly only if the static type of the variable is the derived class type. For example, consider the following code segment:
- // Assembly1.cs
- // Compile with: /target:library
- publicclassBase {
- privateprotectedint myRate = 0;
- }
- publicclassDerivedClass1: Base {
- void Access() {
- Base baseObject = newBase();
- // Error CS1540, because myRate can only be accessed by
- // classes derived from Base.
- // baseObject.myRate = 5;
- // OK, accessed through the current derived class instance
- myRate = 5;
- }
- }
- // Assembly2.cs
- // Compile with: /reference:Assembly1.dll
- classDerivedClass2: Base {
- void Access() {
- // Error CS0122, because myRate can only be
- // accessed by types in Assembly1
- // myRate = 10;
- }
- }
This example contains two files, Assembly1.cs and Assembly2.cs. The first file contains a public base class, Base, and a type derived from it, DerivedClass1. Base owns a private protected member, myRate, which DerivedClass1 tries to access in two ways. The first attempt to access myValue through an instance of Base will produce an error. However, the attempt to use it as an inherited member in DerivedClass1 will succeed. In the second file, an attempt to access myRate as an inherited member of DerivedClass2 will produce an error, as it is only accessible by derived types in Assembly1.
Struct members cannot be private protected because the struct cannot be inherited.

Bohdan StupakPosted May 2, 2020, 8:52 AM
I wonder what does "private protected" mean? From the definition you've provided it sounds more like "internal protected". Also, I'd love to see more about the uses of private constructors i.e. singleton pattern implementation. Still, thanks for the great article.
Mithun SathyadevanPosted Apr 9, 2020, 2:57 PM
How we can access the private date field rate in Main Func??