C# Beginner to advanced – Lesson 43 – Indexers part 1
C# introduces a new concept known as Indexers which are used for treating an object as an array.
The indexers are usually known as smart arrays in C# community.
Defining a C# indexer is much like defining properties.
An indexer is a member that enables an object to be indexed in the same way as an array.
Indexer modifier can be private, public, protected or internal
The return type can be any valid type in C#
Indexers in C# must have at least one parameter. Else the compiler will generate a compilation error.
Syntax for Indexers
Defining a property involves providing a property name.
Indexers are not defined with the names but with the ‘this’ keywords, which refers to the object instance.
Public return type this[parameter type index]
// return the value from the specified index
// set values at the specified index
Mobile automation testing
Components of the .Net framework
Input and output statements
Boxing and Unboxing
Var vs Dynamic vs Object