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.