CIS 573 C# Keywords

last updated: 08/07/2006

There are 77 reserved keywords in C# which cannot be used as identifiers in your program.  To give you a sense of relative size, Java 1.4 has 48 keywords, and ANSI C has only 32.

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

If you are ill-advised enough to want to use a keyword as an identifier, you must use @ as a prefix (@if is legal in C#, but if is not).  For more information, see Microsoft MSDN's C# Language Reference.