using System; class MySequence { public int this[int index] { get { return index + 1; } } } class MainClass { public static void Main() { MySequence sequence = new MySequence(); for(int i=0; i < 8; i++) Console.Write(sequence[i] + " "); Console.WriteLine(); } }
1 2 3 4 5 6 7 8