✅ How does an indexer work and why is it important?
Hello, was just reading a bit about indexers. From what I've understood, an indexer allows our class to behave like an array.
My questions are:
My questions are:
- When we say that our class behave as a array, this mean that each instance created represent an index? Like
MyClass[0]represents the first instance? - What does the
thiskeyword means in the indexer syntax?
- In order to use an indexer, we must always have one of the attribute declared as a 1D array?
- Why are indexers important and helpful