Interviews2 answers
What is indexer in c#?
2 Answers
It allows an instance of the class to behave as an array. We can add a collection and access it through the index.
class IndexerExample
{
// define indexer here
}
//access indexer
IndexerExample ie = new IndexerExample();
// Inserting values in ix[]
ie[0] = "C";
ie[1] = "SHARP";
iE[2] = "CORNER";
Alpesh ManiyaPosted Sep 13, 2024, 9:21 AM EDT
I also wonder the same question
Donald SimPosted Sep 11, 2024, 6:02 AM EDT

