// 单行注释
-/* 多行
- 注释 */
-// TODO:向 Visual Studio 中的任务列表添加注释
-/// 用于文档的单行注释
-/** 多行 注释
- 用于文档 **/
+
+/*
+ * 多行
+ * 注释
+ */
+
+// TODO:向IDE中的任务列表添加注释(VS、Rider都支持)
+
+/// XML 单行注释,用于文档
+
+/**
+ * XML 多行注释,
+ * 用于文档
+ */
string first = "John";
@@ -226,7 +234,7 @@
-关键字 名称 System 别名 占用空间 数据范围 bool 布尔型 Boolean 1 true/false sbyte 有符号字节型 SByte 1 -128 ~ 127 byte 字节型 Byte 1 0 ~ 255 short 短整型 Int16 2 -32,768 ~ 32,767 ushort 无符号短整型 UInt16 2 0 ~ 65,535 int 整型 Int32 4 -2,147,483,648 ~ 2,147,483,647 uint 无符号整型 UInt32 4 0 ~ 4,294,967,295 long 长整型 Int64 8 -2^63 ~ 2^63-1 ulong 无符号长整型 UInt64 8 0 ~ 2^64-1 char 字符型 Char 8 UTF-16 所编码的字符 float 单精度浮点型 Single 4 ±1.5x10^45 ~ ±3.4x10^38 double 双精度浮点型 Double 8 ±5.0x10^-324 ~ ±1.7x10^308 N/A 指针型 IntPtr 与指针相同 与指针相同(受操作系统和处理器位宽影响) N/A 无符号指针型 UIntPtr 与指针相同 与指针相同(受操作系统和处理器位宽影响)
+关键字 名称 System 别名 占用空间(Byte) 数据范围 bool 布尔型 Boolean 1 true/false sbyte 有符号字节型 SByte 1 -128 ~ 127 byte 字节型 Byte 1 0 ~ 255 short 短整型 Int16 2 -32,768 ~ 32,767 ushort 无符号短整型 UInt16 2 0 ~ 65,535 int 整型 Int32 4 -2,147,483,648 ~ 2,147,483,647 uint 无符号整型 UInt32 4 0 ~ 4,294,967,295 long 长整型 Int64 8 -2^63 ~ 2^63-1 ulong 无符号长整型 UInt64 8 0 ~ 2^64-1 char 字符型 Char 8 UTF-16 所编码的字符 float 单精度浮点型 Single 4 ±1.5x10^45 ~ ±3.4x10^38 double 双精度浮点型 Double 8 ±5.0x10^-324 ~ ±1.7x10^308 nint 指针型 IntPtr 与指针相同 与指针相同(受操作系统和处理器位宽影响) nuint 无符号指针型 UIntPtr 与指针相同 与指针相同(受操作系统和处理器位宽影响)
x | y | x&y | x|y | x^y | !x |
---|---|---|---|---|---|
true | true | true | true | false | false |
true | false | false | true | true | false |
true | null | null | true | null | false |
false | true | false | true | true | true |
false | false | false | false | false | true |
false | null | false | null | null | true |
null | true | null | true | null | null |
null | false | false | null | null | null |
null | null | null | null | null | null |
x | y | x & y | x | y | x ^ y | ! x |
---|---|---|---|---|---|
true | true | true | true | false | false |
true | false | false | true | true | false |
true | null | null | true | null | false |
false | true | false | true | true | true |
false | false | false | false | false | true |
false | null | false | null | null | true |
null | true | null | true | null | null |
null | false | false | null | null | null |
null | null | null | null | null | null |