0% found this document useful (0 votes)
6 views1 page

Indexer in C#

Uploaded by

Madhuri Patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Indexer in C#

Uploaded by

Madhuri Patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

INDEXER IN C# PROGRAMMING

Indexers allow our object to be used just like an array, or we can say we can index
the object using [ ] brackets just like arrays.
We can say indexers are special type of properties which adds logic that how can
array or list store the values.
Syntax of indexer resembles to properties.
We can use all access modifiers with indexers and also have return types.
Indexers are the regular members of a class.
Indexer is created with the help of this keyword.
In C# introduce new concept is Indexer. This is very useful for some situation. Let
as discuss something about Indexer.
 Indexer Concept is object act as an array.
 Indexer an object to be indexed in the same way as an array.
 Indexer modifier can be private, public, protected or internal.
 The return type can be any valid C# types.
 Indexers in C# must have at least one parameter. Else the compiler will
generate a compilation error.

You might also like