Indexer

Download c# eBook

Syntax

  • public ReturnType this[IndexType index] { get { ... } set { ... }}

Remarks

Indexer allows array-like syntax to access a property of an object with an index.

  • Can be used on a class, struct or interface.
  • Can be overloaded.
  • Can use multiple parameters.
  • Can be used to access and set values.
  • Can use any type for it's index.

Related Examples

Stats

122 Contributors: 3
Sunday, August 7, 2016
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook