O'Reilly logo

Introducing Visual C# 2010 by Adam Freeman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Properties, Indexers, and Operators

Properties are class members that allow you to expose a characteristic of an object. Indexers are members that allow you to treat a class as though it were an array, using the same index syntax ([]) that is described in Chapter 13.

Properties and indexers both allow you to control access to the fields in your class and give you more control than exposing a field directly. As you'll see when we get into the detail, properties and indexers are very flexible; in fact, they are so rich that they can sometimes blur the distinction between fields and methods.

Custom operators allow you to implement custom operations using standard notation such as + and ++ and allow you to control the implicit and explicit ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required