Indexer allows accessing a member of a class as an array. We can define indexer using this keyword, which indicates that we are creating indexer for current class so an instance of the current class will have access to the member of the class. Once we have to define indexer for the class we can access a member of the class with help of array access operator [].
source https://www.c-sharpcorner.com/article/overview-in-indexer-in-c-sharp/
No comments:
Post a Comment