C # Language Reference

Source: Internet
Author: User
C # Language Reference

Directory
1. Introduction 1
1.1 Hello, world 1
1.2 type 2
1.2.1 predefined Type 3
1.2.2 conversion 5
1.2.3 array type 6
1.2.4 type system consistency 7
1.3 variables and parameters 8
1.4 Automatic Memory Management 11
1.5 expression 13
1.6 statement 14
1.7 Class 17
1.7.1 constant 19
1.7.2 domain 19
1.7.3 Method 20
1.7.4 property 21
1.7.5 event 22
1.7.6 operator 23
1.7.7 index 24
1.7.8 instance constructor 25
1.7.9 destructor 26
1.7.10 static constructor 26
1.7.11 inherit 27
1.8 structure 28
1.9 interface 29
1.10 represents 30
1.11 Union 31
1.12 namespace and set 31
Version 1.13 33
1.14 feature 35
2. syntax structure 37
2.1 translation stage 37
2.2 grammar symbols 37
2.3 preprocessing 38
2.3.1 preprocessing statement 38
2.3.2 # If, # Elif, # else, # endif 39
2.3.3 preprocessing control line 40
2.3.4 # Line 41
2.3.5 preprocessing identifier 41
2.3.6 preprocessing expression 41
2.3.7 interaction with blank space 42
2.4 syntax analysis 43
2.4.1 input 43
2.4.2 input character 43
2.4.3 line terminator 43
2.4.4 note 43
2.4.5 blank 44
2.4.6 mark 45
2.5 syntax analysis 45
2.5.1 identifier 45
2.5.2 keyword 46
2.5.3 data symbol 46
2.5.4 operator and punctuation 51
2.5.5 Unicode conversion Character Sequence 51
3. Basic Concepts 53
3.1 statement 53
3.2 member 55
3.2.1 namespace member 55
3.2.2 structure member 55
3.2.3 enumeration member 55
3.2.4 class member 56
3.2.5 interface member 56
3.2.6 array member 56
3.2.7 representative member 56
3.3 member access 56
3.3.1 declared accessibility 56
3.3.2 accessible domain 57
3.3.3 protected access 59
3.3.4 accessibility constraints 60
3.4 signature and heavy load 60
3.5 range 61
3.5.1 name hiding 63
3.6 namespace or type name 65
3.6.1 qualified name 66
4. Type 67
4.1 Value Type 67
4.1.1 default constructor 68
4.1.2 structure type 69
4.1.3 simple type 69
4.1.4 integer 70
4.1.5 floating point type 71
4.1.6 decimal type 72
4.1.7 Boolean Type 72
4.1.8 Enumeration type 72
4.2 reference type 72
4.2.1 category 73
4.2.2 object type 73
4.2.3 string type 73
4.2.4 interface type 74
4.2.5 array type 74
4.2.6 stands for Type 74
4.3 packaging and package settlement 74
4.3.1 packaging conversion 74
4.3.2 unpack conversion 75
5. Variable 77
5.1 variable type 77
5.1.1 static variable 77
5.1.2 instance variable 77
5.1.3 array element 78
5.1.4 value parameter 78
5.1.5 reference parameter 78
5.1.6 output parameter 78
5.1.7 local variable 79
5.2 default value 79
5.3 clear value assignment 79
5.3.1 Initial Value variable 81
5.3.2 non-Initial Value variable 82
5.4 variable reference 82
6. Convert 83
6.1 implicit conversion 83
6.1.1 identity conversion 83
6.1.2 implicit value conversion 83
6.1.3 implicit enumeration conversion 84
6.1.4 implicit reference conversion 84
6.1.5 conversion 84
6.1.6 implicit constant expression conversion 84
6.1.7 User-Defined implicit conversion 85
6.2 explicit conversion 85
6.2.1 explicit numeric conversion 85
6.2.2 explicit enumeration type conversion 86
6.2.3 explicit conversion of reference types 86
6.2.4 unpacking and conversion 87
6.2.5 custom explicit conversion 87
6.3 standard conversion 87
6.3.1 standard implicit conversion 87
6.3.2 standard explicit conversion 88
6.4 User-Defined conversion 88
6.4.1 User-Defined conversions allowed 88
6.4.2 User-Defined conversion value 88
6.4.3 User-Defined implicit conversion 89
6.4.4 custom explicit type conversion 89
7. expression 91
7.1 expression classification 91
7.1.1 expression value 92
7.2 operator 92
7.2.1 operator priority and combination sequence 92
7.2.2 Operator Overloading 93
7.2.3 unary operator overload analysis 94
7.2.4 binary operator overload analysis 94
7.2.5 Candidate User-Defined operators 95
7.2.6 digital upgrade 95
7.3 member query 96
7.3.1 base type 97
7.4 function member 97
7.4.1 parameter list 99
7.4.2 heavy load analysis 100
7.4.3 function members call 102
7.4.4 search for virtual function members 103
7.4.5 search for interface function members: 103
7.5 main expressions 103
7.5.1 texts 103
7.5.2 simple name 104
7.5.3 brackets 105
7.5.4 access 105
7.5.5 call expression 107
7.5.6 element access 109
7.5.7 this access is 110
7.5.8 base access 111
7.5.9 increment and decrease suffix operator 111
7.5.10 new operator 112
7.5.11 typeof operator 116
7.5.12 the sizeof operator 116
7.5.13 checked and unchecked operators 117
7.6 one-dimensional expression 119
7.6.1 unary positive value operator 119
7.6.2 negative decimal value operator 119
7.6.3 logical non-operator 120
7.6.4 bitwise complement operator 120
7.6.5 indirect operator 120
7.6.6 address operator 120
7.6.7 prefix increment and Decrement Operators 120
7.6.8 forced type conversion expression 121
7.7 Arithmetic Operator 122
7.7.1 multiply operator 122
7.7.2 division operators 123
7.7.3 the remainder operator is 124.
7.7.4 addition operator 124
7.7.5 subtraction operator 126
7.8 shift operator 127
7.9 Relational operators 128
7.9.1 integer comparison operator 129
7.9.2 floating point comparison operator 129
7.9.3 fractional comparison operator 130
7.9.4 Boolean equality operator 130
7.9.5 enumerated comparison operator 130
7.9.6 equal quote type operator 130
7.9.7 string equality operator 132
7.9.8 stands for equal operator 132
7.9.9 "is" operator 132
7.10 logical operators 133
7.10.1 integer logical operator 133
7.10.2 enumeration logical operator 133
7.10.3 Boolean logical operator 134
7.11 conditional logical operators 134
7.11.1 Boolean condition logical operator 134
7.11.2 custom conditional logical operators 135
7.12 conditional operator 135
7.13 value assignment operator 136
7.13.1 simple assignment 136
7.13.2 combination assignment 138
7.13.3 event assignment 139
7.14 expression 139
7.15 constant expression 139
7.16 Boolean expression 140
8. Statement 141
8.1 endpoints and accessibility 141
8.2 block 142
8.2.1 statements 143
8.3 empty statement 143
8.4 label statement 144
8.5 statement 144
8.5.1 local variable declaration 144
8.5.2 local constant declaration 145
8.6 expression statement 145
8.7 SELECT statement 146
8.7.1 if statement 146
8.7.2 switch statement 147
8.8 repeated statements 150
8.8.1 while statement 151
8.8.2 do statement 151
8.8.3 for 151
8.8.4 foreach statement 153
8.9 jump statement 154
8.9.1 break statement 154
8.9.2 continue statement 155
8.9.3 GOTO statement 155
8.9.4 Return Statement 156
8.9.5 throw statement 156
8.10 try statement 157
8.11 checked and unchecked statements 159
8.12 lock statement 159
9. namespaces 161
9.1 compilation unit 161
9.2 namespace declaration 161
9.3 usage instructions 162
9.3.1 alias 163
9.3.2 use namespace indication 165
9.4 namespace member 166
9.5 type declaration 167
10. Class 169
10.1 class declaration 169
10.1.1 class modifier 169
10.1.2 basic class specification 170
10.1.3 subject 172
10.2 class members 172
10.2.1 inherit 173
10.2.2 new modifier 173
10.2.3 access modifier 174
10.2.4 element type 174
10.2.5 static and instance Member 174
10.2.6 nested 175
10.3 constant 175
10.4 domain 176
10.4.1 static and instance domain 177
10.4.2 read-only domain 178
10.4.3 domain initialization 179
10.4.4 variable initialization function 179
10.5 METHOD 181
10.5.1 method parameter 182
10.5.2 static and instance method 185
10.5.3 Virtual Methods 186
10.5.4 coverage method 187
10.5.5 abstract method 189
10.5.6 external method 190
10.5.7 method body 191
10.5.8 method overload 191
10.6 attribute 191
10.6.1 Static Property 192
10.6.2 virtual attribute 192
10.6.3 overwrite attribute 193
10.6.4 abstract attribute 194
10.6.5 access character 194
10.7 event 199
10.8 index 202
10.8.1 index overload 205
10.8.2 virtual index 205
10.8.3 covering indexes 205
10.8.4 abstraction index 206
10.9 operator 206
10.9.1 unary operator 207
10.9.2 binary operator 207
10.9.3 conversion operator 208
10.10 instance constructor 209
10.10.1 constructor initialization function 210
10.10.2 instance variable initialization function 210
10.10.3 constructor execution 210
10.10.4 the default constructor is 212.
10.10.5 private constructor 213
10.10.6 optional constructor parameter 213
10.11 destructor 213
10.12 static constructor 214
10.12.1 class loading and initialization 215
11. Structure 217
11.1 structure declaration 217
11.1.1 structure modifier 217
11.1.2 interface 217
11.1.3 struct 217
11.2 structure member 217
11.3 structure example 217
11.3.1 database integer 217
11.3.2 database Boolean 219
12. array 221
12.1 array type 221
12.1.1 system. array type 222
12.2 create an array 222
12.3 array element access 222
12.4 array member 222
12.5 array covariance 222
12.6 array initialization function 223
13. Interface 225
13.1 interface declaration 225
13.1.1 interface modifier 225
13.1.2 basic interface 225
13.1.3 interface subject 226
13.2 interface member 226
13.2.1 method 227
13.2.2 interface property 227
13.2.3 interface event 228
13.2.4 interface indexing 228
13.2.5 access 228 by interface members
13.3 fully valid interface member name 230
13.4 interface implementation 230
13.4.1 explicitly interface member Implementation Program 231
13.4.2 interface ing 233
13.4.3 interface Implementation Program inheritance 235
13.4.4 interface re-implement program 236
13.4.5 abstract class and interface 238
14. enumerative 239
14.1 enumeration declaration 239
14.2 enumeration member 240
14.3 enumeration values and Operations 242
15. Representing 243
15.1 representative statement 243
15.1.1 types that can be merged: 244
15.2 represents instantiation 244
15.3 multi-point transmission represents 244
15.4 indicates calling 244
16. 245 exception
16.1 exception generation 245
16.2 system. exception class 245
16.3 how to handle exceptions 245
16.4 general exception 246
17. Attribute 247
17.1 Attribute Class 247
17.1.1 attributeusage attribute 247
17.1.2 location and name parameter 248
17.1.3 property parameter type 248
17.2 specification 249
17.3 attribute instance 251
17.3.1 compilation of an attribute 251
17.3.2 a runtime retrieval 252 for a property instance
17.4 reserved attributes 252
17.4.1 attributeusage property 252
17.4.2 condition attribute 253
17.4.3 discarded attribute 255
18. Dangerous code 257
18.1 dangerous code 257
18.2 pointer type 257
19. Interoperability 259
19.1 comimport attributes 259
19.2 comregisterfunction attribute 259
19.3 comsourceinterfaces attributes 260
19.4 comvisible attribute 260
19.5 dispid attribute 260
19.6 dllimport attribute 260
19.7 fieldoffset attribute 261
19.8 globalobject attribute 261
19.9 guid property 262
19.10 hasdefaultinterface attribute 262
19.11 importedfromtypelib attribute 262
19.12 In and Out attributes 262
19.13 interfacetype attribute 263
19.14 financialas attribute 263
19.15 noidispatch attributes 264
19.16 nonserialized property 264
19.17 predeclared attributes 264
19.18 preservesig attribute 264
19.19 serializable attribute 265
19.20 structlayout attribute 265
19.21 typelibfunc attributes 265
19.22 typelibtype attribute 265
19.23 typelibvar attribute 266
19.24 supported enumeration 266
20. See 269

Attachment: c# .doc (1531 K) Downloads: 101

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.