C#
An identifier is a name used to identify a class, variable, function, or any other user-
defined item. The basic rules for naming classes in C# are as follows:
A name must begin with a letter that could be followed by a sequence of letters,
digits (0 - 9) or underscore. The first character in an identifier cannot be a
digit.
It must not contain any embedded space or symbol such as ? - +! @ # % ^ &
* ( ) [ ] { } . ; : " ' / and \. However, an underscore ( _ ) can be used.
It should not be a C# keyword.
C# Keywords
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.
In C#, some identifiers have special meaning in context of code, such as get and set
are called contextual keywords.
The following table lists the reserved keywords and contextual keywords in C#:
Dostları ilə paylaş: