Table of Contents 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Notes DownloadECMA-334 C# Language Specification 17 Classes 17.2 Class members
Paragraph 11 The members of a class consist of the members introduced by its class-member-declarations and the members inherited from the direct base class. class-member-declarations : class-member-declaration class-member-declarations class-member-declaration class-member-declaration : constant-declaration field-declaration method-declaration property-declaration event-declaration indexer-declaration operator-declaration constructor-declaration destructor-declaration static-constructor-declaration type-declaration
Paragraph 21 The members of a class are divided into the following categories:
Paragraph 31 Members that can contain executable code are collectively known as the function members of the class. 2 The function members of a class are the methods, properties, events, indexers, operators, instance constructors, destructors, and static constructors of that class.
Paragraph 41 A class-declaration creates a new declaration space (§10.3), and the class-member-declarations immediately contained by the class-declaration introduce new members into this declaration space. 2 The following rules apply to class-member-declarations:
- 2 Constants, which represent constant values associated with that class (§17.3).
- 3 Fields, which are the variables of that class (§17.4).
- 4 Methods, which implement the computations and actions that can be performed by that class (§17.5).
- 5 Properties, which define named characteristics and the actions associated with reading and writing those characteristics (§17.6).
- 6 Events, which define notifications that can be generated by that class (§17.7).
- 7 Indexers, which permit instances of that class to be indexed in the same way as arrays (§17.8).
- 8 Operators, which define the expression operators that can be applied to instances of that class (§17.9).
- 9 Instance constructors, which implement the actions required to initialize instances of that class (§17.10)
- 10 Destructors, which implement the actions to be performed before instances of that class are permanently discarded (§17.12).
- 11 Static constructors, which implement the actions required to initialize that class itself (§17.11).
- 12 Types, which represent the types that are local to that class (§16.5).
Paragraph 51 The inherited members of a class (§17.2.1) are not part of the declaration space of a class. [Note: Thus, a derived class is allowed to declare a member with the same name or signature as an inherited member (which in effect hides the inherited member). end note]
- 3 Instance constructors, destructors, and static constructors must have the same name as the immediately enclosing class. 4 All other members must have names that differ from the name of the immediately enclosing class.
- 5 The name of a constant, field, property, event, or type must differ from the names of all other members declared in the same class.
- 6 The name of a method must differ from the names of all other non-methods declared in the same class. 7 In addition, the signature (§10.6) of a method must differ from the signatures of all other methods declared in the same class.
- 8 The signature of an instance constructor must differ from the signatures of all other instance constructors declared in the same class.
- 9 The signature of an indexer must differ from the signatures of all other indexers declared in the same class.
- 10 The signature of an operator must differ from the signatures of all other operators declared in the same class.
|Jagger Software Ltd|
|Company # 4070126|
|VAT # 762 5213 42|