3
Reply

What is Indexer in C#

Balamurugan

Balamurugan

15y
6.7k
0
Reply

    Additional information

    Indexer allows to make an object as a Array. Which is also implementing Iterator Patterns in .NET

     

    Indexers are a new concept in C#. Indexers enable a class object to function as an array. Implementing indexers is similar to implementing properties using the get and set functions. The only different is that when you call an indexer, you pass an indexing parameter. Accessing an indexer is similar to accessing an array. Indexers are nameless, so the this keyword declares indexers.

    http://kalitinterviewquestions.blogspot.com/

    Indexer is virtual array and it same as property but here you can store collection of values.