2.2 Identifiers and Keywords

Identifiers are names programmers choose for their types, methods , variables , etc. An identifier must be a whole word, essentially made up of Unicode characters starting with a letter or underscore , and may not clash with a keyword. As a special case, the @ prefix may be used to avoid a clash with a keyword, but is not considered part of the identifier. For instance, the following two identifiers are equivalent:

Ko figs/backwards_r.gif n @Ko figs/backwards_r.gif n

C# identifiers are case-sensitive, though for compatibility with other languages, you should not differentiate public or protected identifiers by case alone.

Here is a list of C# keywords:

 abstract 
 as 
 base 
 bool 
 break 
 byte 
 case 
 catch 
 char 
 checked 
 class 
 const 
 continue 
 decimal 
 default 
 delegate 
 do 
 double 
 else 
 enum 
 event 
 explicit 
 extern 
 false 
 finally 
 fixed 
 float 
 for 
 foreach 
 goto 
 if 
 implicit 
 in 
 int 
 interface 
 internal 
 is 
 lock 
 long 
 namespace 
 new 
 null 
 object 
 operator 
 out 
 override 
 params 
 private 
 protected 
 public 
 readonly 
 ref 
 return 
 sbyte 
 sealed 
 short 
 sizeof 
 stackalloc 
 static 
 string 
 struct 
 switch 
 this 
 throw 
 true 
 try 
 typeof 
 uint 
 ulong 
 unchecked 
 unsafe 
 ushort 
 using 
 virtual 
 void 
 while 
       


C# in a Nutshell
C # in a Nutshell, Second Edition
ISBN: 0596005261
EAN: 2147483647
Year: 2005
Pages: 963

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net