class Example { private int[] arr = new[] { 0, 1, 2 }; // [] overload public int this[int index] { get => arr[index]; set => arr[index] = value; } }