This example shows how to declare and use an indexer in C#. The class Sample has a private array and an indexer that lets you get or set values using square brackets. When you create an instance and use s[1], it calls the get accessor returning the value at index 1. When you assign s[1] = 50, it calls the set accessor updating the value. The execution table traces these steps and shows how the internal array changes. Beginners often wonder why square brackets work on objects; it's because of the indexer declaration. Also, if you remove the set accessor, you cannot assign values, causing a compile error.