using System; class IndexerClass { public int this [int index] // Indexer declaration { get { Console.WriteLine("GET {0}", index); return 0; } set { Console.WriteLine("SET {0} {1}", index, value); } } } public class MainClass { public static void Main() { IndexerClass b = new IndexerClass(); int x = b[5]; x++; b[5] = x; Console.WriteLine("x={0}", x); } }