C#关键字


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

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

保留关键字

abstractasbaseboolbreakbytecase
catchcharcheckedclassconstcontinuedecimal
defaultdelegatedodoubleelseenumevent
explicitexternfalsefinallyfixedfloatfor
foreachgotoifimplicitinin (泛型修饰符)int
interfaceinternalislocklongnamespacenew
nullobjectoperatoroutout (泛型修饰符)overrideparams
privateprotectedpublicreadonlyrefreturnsbyte
sealedshortsizeofstackallocstaticstringstruct
switchthisthrowtruetrytypeofuint
ulonguncheckedunsafeushortusingvirtualvoid
volatilewhile




上下文关键字

addaliasascendingdescendingdynamicfromget
globalgroupintojoinletorderbypartial (类型)
partial (方法)removeselectset


更新于:2020年6月22日

555 次浏览

开启您的职业生涯

完成课程获得认证

开始学习
广告
© . All rights reserved.