This program includes a List class with an indexer we define. The Layout class contains an indexer that has get and set method bodies. These accessors have logic that ensures the array will not will be accessed out-of-bounds.

Note : C# indexers must have at least one parameter; otherwise, the compiler gives an error.