Keywords in C#
Keywords:
v C#
contains reserved words that have special meaning for the compiler. These
reserved words are called "keywords".
v C#
is rich in features and keywords, which help in making the language strong and
versatile.
v These
keywords also have special significance and hence cannot be used as identifier
names for variable name, class name, constants names or interface names etc.
v If
we want to use the keywords as identifiers, we may prefix the keyword with @ character.
The keywords in C# are categorized
under various groups. These are:
1.
Modifier Keywords
2.
Access Modifier Keywords
3.
Statement Keywords
4.
Method Parameter Keyword
5.
Access Keywords
6.
Namespace Keywords
7.
Literal Keywords
8.
Operator Keywords
9.
Contextual Keywords
10.Type Keywords
11.Query Keywords
Type |
Keywords |
Modifier Keywords |
abstract,
async, const, event, extern, new, override, partial, readonly, sealed,
static, unsafe, virtual, volatile |
Access Modifier
Keywords |
public,
private, protected, internal |
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 |
Method Parameter
Keyword |
params,
ref, out |
Access Keywords |
base,
this |
Namespace Keywords |
using, .
operator, :: operator, extern alias |
Literal Keywords |
null,
false, true, value, void |
Operator Keywords |
as,
await, is, new, sizeof, typeof, stackalloc, checked, unchecked |
Contextual Keywords |
add,
var, dynamic, global, set, value |
Type Keywords |
bool,
byte, char, class, decimal, double, enum, float, int, long, sbyte, short,
string, struct, uint, ulong, ushort |
Query Keywords |
from,
where, select, group, into, orderby, join, let, in, on, equals, by,
ascending, descending |
Comments
Post a Comment