Sponsored Links
-->

Monday, November 20, 2017

Sequence Indexer Part 2 - TIS-100 - Programming Puzzles - Ep16 ...
src: i.ytimg.com

In object-oriented programming, an indexer allows instances of a particular class or struct to be indexed just like arrays. It is a form of operator overloading.


Video Indexer (programming)



Implementation

Indexers are implemented through the get and set accessors for the operator[]. They are similar to properties, but differ by not being static, and the fact that indexers' accessors take parameters. The get and set accessors are called as methods using the parameter list of the indexer declaration, but the set accessor still has the implicit value parameter.


Maps Indexer (programming)



Example

Here is a C# example of the usage of an indexer in a class:


Sequence Indexer - TIS-100 - Programming Puzzles - Ep18 - YouTube
src: i.ytimg.com


See also

  • Property (programming)
  • Mutator method

Sequence Indexer - TIS-100 - Programming Puzzles - Ep15 - YouTube
src: i.ytimg.com


References


Source of article : Wikipedia