What is the use of Indexers in C#?

Why do we use Indexers in C#? How does indexers help in C# programming?

  • Soni
  • 18 मई
  • 3852 दृश्य
  • 2 उत्तर
Your Answer

C# indexers are normally known as smart arrays. A C# indexer is a class property that enables you to access a member variable of a class or struct using the features of an array. In C#, indexers are generated using this keyword. Indexers in C# are suitable for both classes and structs. 
Defining an indexer enables you to create a class like that can allows its items to be accessed an array.  Instances of that class can be accessed using the [] array access operator.
 

0
c sharp programming
मॉक परीक्षण अभ्यास के लिए
c sharp programming