Introduction
An indexer lets you access objects like arrays using square brackets. It makes your class easier to use and feels natural.
You want to access elements inside a class using an index, like a list or array.
You have a collection inside your class and want to provide easy access to its items.
You want to hide the internal data structure but still allow users to get or set values by position.
You want to make your class behave like a container with simple syntax.