O'Reilly logo

C# Primer Plus by Klaus Michelsen

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

Summary

In this chapter, you learned about the following function class members: properties, indexers, user-defined operator overloading, and user-defined conversions. We also looked at another kind of class member called nested types. The most important points in this chapter are noted in the following paragraphs.

Properties are better suited than accessor and mutator methods to access instance variables. The property is accessed in the same way as a public instance variable, but when a value is assigned or retrieved via the property, programmer defined set statement blocks and get statement blocks are executed. A property does not have to represent any particular instance variable but can merely return a calculated value.

Properties are as ...

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