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

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 Keywords

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


Updated on: 2020-06-22T08:58:35+05:30

661 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements