Constructor Chaining

Calling another constructor so initialization logic can be reused.

What is Constructor Chaining in C#?

Constructor Chaining — Calling another constructor so initialization logic can be reused.

class Store
{
    static int locationCount = 3;
    const int maxItems = 100;
    readonly string name;

    Store(string name)
    {
        this.name = name;
    }
}

Level: Journeyman · More C# terms at this level

Updated

In other subjects