Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
494 CHAPTER 17: CLASSES the value-returning F method results in a compile-time error because control can flow off the end of the method body. The G and H methods are correct because all possible execution paths end in a return statement that specifies a return value. end example] 17.5.9 Method overloading The method overload resolution rules are described in §14.4.2. 17.6 Properties A property is a member that provides access to a characteristic of an object or a class. Examples of properties include the length of a string, the size of a font, the caption of a window, the name of a customer, and so on. Properties are a natural extension of fields--both are named members with associated types, and the syntax for accessing fields and properties is the same. However, unlike fields, properties do not denote storage locations. Instead, properties have accessors that specify the statements to be executed when their values are read or written. Properties thus pro- vide a mechanism for associating actions with the reading and writing of an object's characteris- tics; furthermore, they permit such characteristics to be computed. Properties are declared using property-declarations: property-declaration: attributes opt property-modifiers opt property-modifiers: property-modifier property-modifiers property-modifier: type member-name { accessor-declarations } property-modifier