9.Namespaces 284
9.1Compilation units 284
9.2Namespace declarations 284
9.3Extern aliases 285
9.4Using directives 286
9.4.1Using alias directives 287
9.4.2Using namespace directives 289
9.5Namespace members 291
9.6Type declarations 291
9.7Namespace alias qualifiers 292
9.7.1Uniqueness of aliases 293
10.Classes 295
10.1Class declarations 295
10.1.1Class modifiers 295
10.1.1.1Abstract classes 295
10.1.1.2Sealed classes 296
10.1.1.3Static classes 296
10.1.2Partial modifier 297
10.1.3Type parameters 297
10.1.4Class base specification 298
10.1.4.1Base classes 298
10.1.4.2Interface implementations 299
10.1.5Type parameter constraints 300
10.1.6Class body 304
10.2Partial types 304
10.2.1Attributes 304
10.2.2Modifiers 305
10.2.3Type parameters and constraints 305
10.2.4Base class 305
10.2.5Base interfaces 306
10.2.6Members 306
10.2.7Partial methods 307
10.2.8Name binding 309
10.3Class members 310
10.3.1The instance type 311
10.3.2Members of constructed types 311
10.3.3Inheritance 312
10.3.4The new modifier 313
10.3.5Access modifiers 313
10.3.6Constituent types 313
10.3.7Static and instance members 313
10.3.8Nested types 314
10.3.8.1Fully qualified name 315
10.3.8.2Declared accessibility 315
10.3.8.3Hiding 316
10.3.8.4this access 316
10.3.8.5Access to private and protected members of the containing type 317
10.3.8.6Nested types in generic classes 318
10.3.9Reserved member names 319
10.3.9.1Member names reserved for properties 319
10.3.9.2Member names reserved for events 320
10.3.9.3Member names reserved for indexers 320
10.3.9.4Member names reserved for destructors 320
10.4Constants 320
10.5Fields 322
10.5.1Static and instance fields 323
10.5.2Readonly fields 324
10.5.2.1Using static readonly fields for constants 324
10.5.2.2Versioning of constants and static readonly fields 324
10.5.3Volatile fields 325
10.5.4Field initialization 326
10.5.5Variable initializers 327
10.5.5.1Static field initialization 327
10.5.5.2Instance field initialization 329
10.6Methods 329
10.6.1Method parameters 331
10.6.1.1Value parameters 333
10.6.1.2Reference parameters 333
10.6.1.3Output parameters 334
10.6.1.4Parameter arrays 335
10.6.2Static and instance methods 338
10.6.3Virtual methods 338
10.6.4Override methods 340
10.6.5Sealed methods 342
10.6.6Abstract methods 343
10.6.7External methods 344
10.6.8Partial methods 345
10.6.9Extension methods 345
10.6.10Method body 346
10.6.11Method overloading 347
10.7Properties 347
10.7.1Static and instance properties 348
10.7.2Accessors 348
10.7.3Automatically implemented properties 353
10.7.4Accessibility 354
10.7.5Virtual, sealed, override, and abstract accessors 355
10.8Events 357
10.8.1Field-like events 359
10.8.2Event accessors 360
10.8.3Static and instance events 362
10.8.4Virtual, sealed, override, and abstract accessors 362
10.9Indexers 362
10.9.1Indexer overloading 366
10.10Operators 366
10.10.1Unary operators 368
10.10.2Binary operators 369
10.10.3Conversion operators 369
10.11Instance constructors 371
10.11.1Constructor initializers 372
10.11.2Instance variable initializers 373
10.11.3Constructor execution 373
10.11.4Default constructors 375
10.11.5Private constructors 376
10.11.6Optional instance constructor parameters 376
10.12Static constructors 376
10.13Destructors 379
10.14Iterators 380
10.14.1Enumerator interfaces 381
10.14.2Enumerable interfaces 381
10.14.3Yield type 381
10.14.4Enumerator objects 381
10.14.4.1The MoveNext method 381
10.14.4.2The Current property 383
10.14.4.3The Dispose method 383
10.14.5Enumerable objects 383
10.14.5.1The GetEnumerator method 384
10.14.6Implementation example 384
10.15Async Functions 390
10.15.1Evaluation of a task-returning async function 391
10.15.2Evaluation of a void-returning async function 391
Do'stlaringiz bilan baham: |