What are indexers in c# .net?



What are indexers in c# .net?..

Answer / Shashi Yadav

Indexers allow you to access elements of an object as if they were part of an array, using square brackets. In other words, they enable properties that behave like arrays. Here's an example: {"example": "public int this[int index] {
get {
// Code for getting element by index
}
set {
// Code for setting element by index
}}"}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

In a site to turn off cookies for one page which method is followed?

1 Answers   Siebel,


What is Dispose method in .NET ?

9 Answers   247Customer, KAP, TCS,


What is a view? What is the use of it?

1 Answers   Accenture,


What language do desktop applications use?

1 Answers  


Can you see a loop recorder?

1 Answers  


Can you specify an access modifier for an enumeration?

1 Answers  


What is namespace in oop?

1 Answers  


How To Maintain Transaction In C#?

1 Answers   Phoenix Technologies,


How do I declare inout arguments in c#?

1 Answers  


What is difference between list and dictionary in c#?

1 Answers  


What is the boxing and unboxing in c#?

1 Answers  


What is xaml in c#?

1 Answers  


Categories