C# 中的关键字

csharpprogrammingserver side programming更新于 2025/8/13 0:37:17

关键字是 C# 编译器预定义的保留字。这些关键字不能用作标识符。但是,如果您想使用这些关键字作为标识符,可以在关键字前添加 @ 字符。

以下是 C# 中的两种关键字类型。

保留关键字

abstractasbaseBoolbreakbytecase
catchcharcheckedClassconstcontinuedecimal
defaultdelegatedoDoubleelseenumevent
explicitexternfalseFinallyfixedfloatfor
foreachgotoifImplicitinin (generic modifier)int
interfaceinternalisLocklongnamespacenew
nullobjectoperatorOutout (generic modifier)overrideparams
privateprotectedpublicReadonlyrefreturnsbyte
sealedshortsizeofstackallocstaticstringstruct
switchthisthrowTruetrytypeofuint
ulonguncheckedunsafeUshortusingvirtualvoid
volatilewhile




上下文关键词

addaliasascendingdescendingdynamicfromget
globalgroupintojoinletorderbypartial (type)
partial(method)removeselectset



相关文章