C# Keywords

What Are Keywords in C#?

C# is rich in features and keywords which help in making the language strong and versatile. Keywords are reserved words with special meaning that is known to the compiler. These keywords also have special significance and hence cannot be used as identifier name for variable-name, class-name or interface-name. In this chapter, you will get to know more about C# keywords.

C# Keywords and Its Type

Keywords are reserved words having special meaning whose meaning is already defined to the compiler. The keywords in C# are categorized under various groups. These are:

TypeKeywords
Modifier Keywordsabstract, async, const, event, extern, new, override, partial, readonly, sealed, static, unsafe, virtual, volatile
Access Modifier Keywordspublic, private, protected, internal
Statement Keywordsif, else, switch, case, do, for, foreach, in, while, break, continue, default, goto, return, yield, throw, try, catch, finally, checked, unchecked, fixed, lock
Method Parameter Keywordparams, ref, out
Access Keywordsbase, this
Namespace Keywordsusing, . operator, :: operator, extern alias
Literal Keywordsnull, false, true, value, void
Operator Keywordsas, await, is, new, sizeof, typeof, stackalloc, checked, unchecked
Contextual Keywordsadd, var, dynamic, global, set, value
Type Keywordsbool, byte, char, class, decimal, double, enum, float, int, long, sbyte, short, string, struct, uint, ulong, ushort
Query Keywordsfrom, where, select, group, into, orderby, join, let, in, on, equals, by, ascending, descending

Scroll Back to Top