C#
Properties, Arrays, and IndexersC# - Properties, Arrays, and Indexers
Properties as Smart Fields
Defining and Using Properties
What the Compiler Is Really Doing
Read-Only Properties
Inheriting Properties
Advanced Use of Properties
Arrays
Declaring Arrays
Single-Dimensional Array Example
Multidimensional Arrays
Querying for Rank
Jagged Arrays
Treating Objects Like Arrays by Using Indexers
Defining Indexers
Indexer Example
Design Guidelines
Summary
So far, I've described the basic types supported by C# and how to declare and use them in your classes and applications. This tutorial will break the pattern of presenting one major feature of the language per tutorial. In this tutorial, you'll learn about properties, arrays, and indexers because these language features share a common bond. They enable you, the C# class developer, to extend the basic class/field/method structure of a class to expose a more intuitive and natural interface to your class's members.