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 16 Namespaces 16.5 Type declarations
Paragraph 11 A type-declaration is a class-declaration (§17.1), a struct-declaration (§18.1), an interface-declaration (§20.1), an enum-declaration (§21.1), or a delegate-declaration (§22.1). type-declaration : class-declaration struct-declaration interface-declaration enum-declaration delegate-declaration
Paragraph 21 A type-declaration can occur as a top-level declaration in a compilation unit or as a member declaration within a namespace, class, or struct.
Paragraph 31 When a type declaration for a type T occurs as a top-level declaration in a compilation unit, the fully qualified name of the newly declared type is simply T. 2 When a type declaration for a type T occurs within a namespace, class, or struct, the fully qualified name of the newly declared type is N.T, where N is the fully qualified name of the containing namespace, class, or struct.
Paragraph 41 A type declared within a class or struct is called a nested type (§17.2.6).
Paragraph 51 The permitted access modifiers and the default access for a type declaration depend on the context in which the declaration takes place (§10.5.1):
- 2 Types declared in compilation units or namespaces can have public or internal access. 3 The default is internal access.
- 4 Types declared in classes can have public, protected internal, protected, internal, or private access. 5 The default is private access.
- 6 Types declared in structs can have public, internal, or private access. 7 The default is private access.
|Jagger Software Ltd|
|Company # 4070126|
|VAT # 762 5213 42|