Here, In the below problem, We have created an indexer in class ‘Main’. With indexer, we are putting and retrieving values to an array of int type. Indexer use get and set accessor to get and set value from/to the array. Indexer name should be 'this’. Inside class 'Program’, we have created an object of class 'Main’ and that object is now working similar to an array. The reason is one and only indexer. Indexer allows the object to be treated as an array as shown in the program. Index on which value is not assigned will be by default set to 0.