4.Types 97
4.1Value types 97
4.1.1The System.ValueType type 98
4.1.2Default constructors 98
4.1.3Struct types 99
4.1.4Simple types 99
4.1.5Integral types 100
4.1.6Floating point types 101
4.1.7The decimal type 102
4.1.8The bool type 102
4.1.9Enumeration types 103
4.1.10Nullable types 103
4.2Reference types 103
4.2.1Class types 104
4.2.2The object type 104
4.2.3The dynamic type 104
4.2.4The string type 105
4.2.5Interface types 105
4.2.6Array types 105
4.2.7Delegate types 105
4.3Boxing and unboxing 105
4.3.1Boxing conversions 105
4.3.2Unboxing conversions 107
4.4Constructed types 107
4.4.1Type arguments 108
4.4.2Open and closed types 108
4.4.3Bound and unbound types 109
4.4.4Satisfying constraints 109
4.5Type parameters 110
4.6Expression tree types 111
4.7The dynamic type 111
5.Variables 113
5.1Variable categories 113
5.1.1Static variables 113
5.1.2Instance variables 113
5.1.2.1Instance variables in classes 113
5.1.2.2Instance variables in structs 114
5.1.3Array elements 114
5.1.4Value parameters 114
5.1.5Reference parameters 114
5.1.6Output parameters 114
5.1.7Local variables 115
5.2Default values 115
5.3Definite assignment 116
5.3.1Initially assigned variables 117
5.3.2Initially unassigned variables 117
5.3.3Precise rules for determining definite assignment 117
5.3.3.1General rules for statements 118
5.3.3.2Block statements, checked, and unchecked statements 118
5.3.3.3Expression statements 118
5.3.3.4Declaration statements 118
5.3.3.5If statements 118
5.3.3.6Switch statements 119
5.3.3.7While statements 119
5.3.3.8Do statements 119
5.3.3.9For statements 119
5.3.3.10Break, continue, and goto statements 120
5.3.3.11Throw statements 120
5.3.3.12Return statements 120
5.3.3.13Try-catch statements 120
5.3.3.14Try-finally statements 121
5.3.3.15Try-catch-finally statements 121
5.3.3.16Foreach statements 122
5.3.3.17Using statements 122
5.3.3.18Lock statements 122
5.3.3.19Yield statements 123
5.3.3.20General rules for simple expressions 123
5.3.3.21General rules for expressions with embedded expressions 123
5.3.3.22Invocation expressions and object creation expressions 123
5.3.3.23Simple assignment expressions 124
5.3.3.24&& expressions 124
5.3.3.25|| expressions 125
5.3.3.26! expressions 126
5.3.3.27?? expressions 126
5.3.3.28?: expressions 126
5.3.3.29Anonymous functions 127
5.4Variable references 128
5.5Atomicity of variable references 128
Do'stlaringiz bilan baham: |