Prerequisite: Indexers in C#
The multi-dimensional indexer is almost similar to multidimensional arrays. For the efficient content-based retrieval of data, multidimensional indexers are used. To create multi-dimensional indexer you have to pass at least two parameters in the argument list of indexer declaration. To access a single element of a multi-dimensional indexer, use integer subscripts. Each subscript indexes a dimension like the first indexes the row dimension, the second indexes the column dimension and so on.
Example 1: Using get and set accessor
1 2 3 4 5 6 7 8 9
Example 2: Without using the “set” accessor i.e only using Read-Only Property
1 2 3 2 3 4 3 4 5
- C# | Indexers
- C# | Overloading of Indexers
- Difference Between Properties and Indexers in C#
- Different Types of HTML Helpers in ASP.NET MVC
- Difference Between .NET and ASP.NET Framework
- C# Coding Standards
- C# Program to Convert a Binary String to an Integer
- Basics of FileStream in C#
- C# Program for Nested Conditional Operator
- C# Program for Converting Hexadecimal String to Integer
- Program to Input Weekday Number and Print the Weekday in C#
- What is NuGet?
- Top 10 Programming Languages for Blockchain Development
- C# Program to Convert the Octal String to an Integer Number
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.