Keywords in C#


Keywords are reserved words predefined to the C# compiler. These keywords cannot be used as identifiers. However, if you want to use these keywords as identifiers, you may prefix the keyword with the @ character.

The following are the two types of keywords in C#.

Reserved Keywords

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




Contextual Keywords

addaliasascendingdescendingdynamicfromget
globalgroupintojoinletorderbypartial (type)
partial(method)removeselectset


Updated on: 22-Jun-2020

482 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements