Identifiers in c#
Identifiers are tokens or symbols which are uniquely identify the element. They are names of things like variables or fields. Identifiers are names given to namespaces, classes, methods, variables, and interfaces etc. Identifiers in c# are case sensitive. For example abc is not equal to ABC. Identifiers can be combination of letters, numbers, and underscores. Keywords are not defined as identifiers. It can make the identifiers by using Unicode character as “@”.
Valid identifiers in C# are following this rule
· An identifier must start with a letter or an underscore.
· After the first character, it may contain numbers, letters, connectors, etc.
· If the identifier is a keyword, it must be prep ended with “@” .
The following names are valid identifiers in C#:
And some invalid identifiers
1. 2world //error because first letter is number
2. Public //error because it is keyword
3. \u0027format // error because Unicode formatting character