C# - An Introduction - Identifiers
(Page 3 of 9 )
Identifiers are simply names for your items. For example, you are developing a program that contains an item which will add two numbers. You must give this item a name in your code, so that name is also referred to as an identifier because it will identify your item.
I will give you many examples for identifiers later when appropriate. Now we must differentiate between Keywords and Identifiers. Keywords are special words reserved by the language and Identifiers are names which you can use to call your items (I use the word ‘items’ because I am assuming you don’t know of C#’s building blocks, such as: structs, classes, methods, etc.).
For example I can call my programming item “Michael”, which is an item that can output “Hello I like programming in C#” to the screen. The item named “Michael” is an Identifier. I can’t name this item “class”, “int”, or any of the words in Figure 2.1 because they are reserved by C# for special use.
When you name your items you must apply certain rules:
- The first character in the name must start with a letter (uppercase or lowercase) or an underscore (_). I.e.: “_myName”
- The characters after the first can be a digit, an underscore (_), or a letter (uppercase or lowercase)
That’s all what you need to know for now about Keywords and Identifiers.
Next: C# Statements >>
More C# Articles
More By Michael Youssef