Comparison Between Properties and Indexers (C# Programming Guide)
Article
Indexers are like properties. Except for the differences shown in the following table, all the rules that are defined for property accessors apply to indexer accessors also.
Property
Indexer
Allows methods to be called as if they were public data members.
Allows elements of an internal collection of an object to be accessed by using array notation on the object itself.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Learn how to implement read-write, read-only, and write-only class properties using property accessors and access modifiers, and how to implement methods and extension methods for a class.