- Indexer is a concept of using an object like an array.
Syntax:
<modifier> <return type> this [argument list]
- Indexers are implemented through get and set assessors for the [] operator. . The get and set assessors are invoked as methods with the parameter list specified in the indexer declaration.
- Indexer method name must be this.
- One class can have only one indexer.
- The modifier can be private, public, protected or internal.
- Indexers must be instance-based, that is, they cannot be static i.e., C# don't have the concept of static indexers
- A base class indexer is inherited to the derived class.
Indexers
Subscribe to:
Post Comments
(
Atom
)
0 comments :
Post a Comment