Tag Archives: initialize

Make an initializing constructor for a child class in C#

An initializing constructor is a constructor that takes parameters to make it easy to initialize an object’s properties. This example shows how to reuse a class’s initializing constructor for a child class. The following Person class has an initializing constructor. … Continue reading

Posted in classes, OOP | Tagged , , , , , , , , , , , , , , | Leave a comment

Initialize an array of arrays in C#

The example Initialize two-dimensional arrays in C# explains how to initialize a two-dimensional array. An array of arrays is somewhat similar to a two-dimensional array but with some syntax differences. The following code shows how this example declares and initializes … Continue reading

Posted in arrays, syntax | Tagged , , , , , , , , , , , | Leave a comment

Initialize two-dimensional arrays in C#

The example Initialize arrays, lists, and class instances in C# explains how to initialize a one-dimensional array. You can use a similar syntax to initialize multi-dimensional arrays. Use a new statement to indicate the type of array you are initializing. … Continue reading

Posted in arrays, syntax | Tagged , , , , , , , , , , | 1 Comment