• +91 9723535972
  • info@interviewmaterial.com

CSharp Interview Questions and Answers

Question -
What are Indexers in C#?



Answer -

Indexers are called smart arrays that allow access to a member variable. Indexers allow member variables using the features of an array. They are created using the Indexer keyword. Indexers are not static members. 

For ex. Here the indexer is defined the same way.

this[ index]
{
   get{
       // return the value from the specified index of an internal collection
   }
   set{
       // set values at the specified index in an internal collection
   }
}

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners