|
|
|
|||||
|
10 |
What are Identifiers? |
|
||||
|
|
||||||
| Posted - February 05, 2005 | ||||||
|
Identifiers are the names given to classes, methods, variables and
interfaces. It must be a whole word and starts with either an alphabet
or an underscore. They are case sensitive. The main point you should
bear in mind is that the names should not clash with C# keywords. Some programmers use @ prefix as a first character while declaring identifiers to avoid clash with a keyword but it is not a recommended practice. Following names are valid identifiers in C# 1. Hello 2. hello 3. H_ello 4. HelloWorld You should name the variables using the standard DataType prefixes. Also the first alphabet after the prefix should be capitalized. Table 10.1 shows a list of prefixes for the various .NET DataTypes. You will learn more about DataTypes in a later FAQ. Interfaces should be named with
"I" as the first
alphabet so that you can easily distinguish it from a class. It is beyond the scope of this chapter to cover the
prefixes of all the .NET controls. You will find a detailed list of them
on the MSDN Library. |
||||||