This is used to access the object like an array.
Syntax: object[index]
When you use the above syntax, a field can be accessed.
Syntax for Indexer:
Syntax: object[index]
When you use the above syntax, a field can be accessed.
Syntax for Indexer:
public datatype this[int index]
{
get
{
return arrayname[index];
}
set
{
arrayname[index] = value;
}
}
{
get
{
return arrayname[index];
}
set
{
arrayname[index] = value;
}
}