C# Keywords

Introduction

C# is rich in features and keywords which helps to make the language strong and versatile. Keywords are predefined sets of reserved words that have a special meaning that is known to the compiler. These keywords have special significance so that we cannot use them as identifiers for class name, variable name, and interface name. In this blog, you will learn about C# keywords.

C# Keywords List

List of Reserved Keywords is given below table which is available in C# Programming language,

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


C# Keywords Categorized with their types or groups
 

Namespace Keywords using, operator, extern alias
Type Keywords string, int, long, bool, byte, char, class, decimal, double, enum, float, sbyte, short, struct, uint, ulong, ushort
Operator Keywords is, await, as, new, sizeof, typeof, checked, unchecked, stackalloc
Statement Keywords if, else, switch, case, do, for, foreach, in, while, break, continue, default, goto, return, yield, throw, try, catch, finally, checked, unchecked, fixed, lock
Literal Keywords null, false, true, value, void
Modifier Keywords public, private, protected, internal, abstract, async, const, event, extern, new, override, partial, readonly, sealed, static, unsafe, virtual, volatile
Method Parameter Keyword params, ref, out
Access Keywords base, this
Contextual Keywords add, var, dynamic, global, set, value
Query Keywords from, where, select, group, into, orderby, join, let, in, on, equals, by, ascending, descending


Summary

We cannot use C# standard keywords as identifiers for class names, variable names, and interface names.

If you have any query/suggestion on C# keywords, please leave your thoughts in the comment section below.

Thanks for reading and I hope you like it.