
2.2
2.2
关
关
键
键
字
字
与
与
标
标
识
识
符
符
• 关键字是对C#编译器具有特殊意义的
预定义保留标识符。标识符是用来为
程序中各元素进行定义的名字。
• 2.2.1 关键字
• C#中的关键字如表2-1所示,每个关
键字都有特殊的作用,例如using关
键字用于引入命名空间,class关键
字用于声明一个类。
• 注意:
• (1)所有的关键字都是小写的;
• (2)程序中的标识符不能以关键字
命名,除非前面加上“@”前缀。
abstract
const extern int out short
typeof
as continue false interface override sizeof uint
base decimal finally internal params stackalloc ulong
bool default fixed is private static unchecke
d
break delegate float lock protected string unsafe
byte do for long public struct ushort
case double foreach namespac
e
readonly switch using
catch else goto new ref this virtual
char enum if null return throw volatile
checked event implicit object sbyte true void
class explicit in operator sealed try while