Archive for March, 2011

Words reserved in C# (Keywords)

March 26, 2011 1 comment

Some words have special meaning for the compiler C#. These can’t are using how identifiers, at least that using the “@” before of same.
Ex.: @if is an identifier accepts, but IF don’t, because is an word reserved.

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  

Decision Making: Equality and relational operators

This section introduces C#’s if structure, wich allows a program to make a decision based on the truth or falsity of some condition. If the condition is met (i.e., the condition is true), the statement in the body of the if structures executes. If the condition is not met (i.e., the condition is false), the body statement does not execute.

Standart algebraic equality operator or relational operator C# equality or relational operator Example of C# condition Meaning of C# condition


== X == y

X is equal to y


X != y

X is not equal to y

X > y

X is greater than y


X < y

X is less than y


X >= y

X is greater than or equal to y
<= X <=y

X is less than or equal to y

Sources:  C# for experienced programmers – Deitel Developers series

%d bloggers like this: