c# array property code example
Example 1: C# array index tostring
string[] greetings = new string[] {"hi", "hello", "hey there"};
Console.WriteLine(greetings[2].ToString());
Example 2: declare prop array c#
private int[] myNumbers;
public int[] MyNumbers
{
get { return myNumbers; }
set { myNumbers = value; }
}
Example 3: declare prop array c#
class DemoClass
{
public int[] MyNumbers { get; private set; }
public DemoClass(int elements)
{
MyNumbers = new int[elements];
}
}