Sunday, February 15, 2009

Guess output


bool a1 = null == 1; //false Warning The result of the expression is always 'false' since a value of type '<null>' is never equal to 'null' of type 'int'
bool a2 = null != 1; //true Warning    The result of the expression is always 'true' since a value of type '<null>' is never equal to 'null' of type 'int'
bool a3 = null > 0; //false Warning Comparing with null of type 'int?' always produces 'false'
bool a4 = null < 0; //false Warning    Comparing with null of type 'int?' always produces 'false'

No comments: