C# Keywords


  • Keywords are the reserved and predefined words that cannot be used as the identifiers.
  • These are the language specific words.
  • A keyword is an essential element of a language definition.
  • If anybody wants to use keyword as the identifier. then he has to use the "@" as the prefix of that keyword. Like 'for' is a keyword if anybody wants to use it as identifier then he can do so by adding prefix @ to this like "@ for".
  • C# contains so many keywords which are given below in the tables:

Reserved Keywords


Reserved keywords have a special meaning and they cannot be used as identifiers. in the program unless they include "@" as a prefix.


Reserved Keywords
abstract as base bool break byte case
catch char checked class const continue decimal
default delegate do double else enum event
explicit extern false finally fixed float for
foreach goto if implicit in in (generic modifier) int
interface internal is lock long namespace new
null object operator out out (generic modifier) override params
private protected public readonly ref return sbyte
sealed short sizeof stackalloc static string struct
switch this throw true try typeof uint
ulong unchecked unsafe ushort using virtual void
volatile while

Contextual Keyword


Contextual keywords have special meaning only in a limited program context and can be used as identifiers outside that context.


Contextual Keywords
add alias ascending descending dynamic from get
global group into join let orderby partial (type)
partial
(method)
remove select set