Language Basics C# Book

You can declare a single-dimensional array of five integers as shown in the following example:
int[] array = new int[5];
This array contains the elements from array[0] to array[4].
The new operator is used to create the array and initialize the array elements to their default values.
In this example, all the array elements are initialized to zero.
class MainClass
{
static void Main()
{
int[] array = new int[5];

System.Console.WriteLine(array[0]);
System.Console.WriteLine(array[1]);
System.Console.WriteLine(array[2]);
System.Console.WriteLine(array[3]);
System.Console.WriteLine(array[4]);
}
}
The following code defines an array that stores string elements.
string[] stringArray = new string[6];