Properties

Properties are class members that provide access to object characteristics. Properties are a natural extension of fields, as they provide similar syntax for working with them. However, unlike fields, properties do not denote storage locations. Instead, properties have access methods that specify the statements to be executed when property values are read or written. Properties thus provide a mechanism for associating actions with the reading and writing of an object's attributes.

property-declaration:

property-inline-declaration

property-inline-declaration:

attributesopt   property-modifiersopt   Property   member-name   property-indexersopt   :   type

inline-accessor-declarations   End Property   member-nameopt   ;

property-modifiers:

property-modifier

property-modifiers   property-modifier

property-modifier:

New

Public

Protected

Friend

Private

Shared

Virtual

Final

Override

Abstract

member-name:

identifier

interface-type   .   identifier

Property declarations are subject to the same rules as method declarations with regard to valid combinations of modifiers.

A property declaration should include the property type, name, access methods and optionally parameters.

Additional information is contained in the following subsections:

See also:

Classes