How to understand this sentence?
How It Works
The code in Main() creates and uses an instance of the MyClass class defined in MyClass.cs. Instantiating this class must be performed using a nondefault constructor because the default constructor of MyClass is private:
private MyClass() : this("Default Name")
{
}
Using this("Default Name") ensures that Name gets a value if this constructor is ever called, which is possible if this class is used to derive a new class. This is necessary because not assigning a value to the Name field could be a source of errors later.
I don't understand, how to call a private constructor if deriving a new class?
|