Null is a special keyword that indicates the absense of a value. Expectedly, it's stated in the code as null .

Null can be used instead of reference-type objects when calling a method. Reference-type objects are objects of every built-in and user-defined types, except for bool, int, float and complex. Some methods might also return a null if there's no appropriate data to be returned.

Because null keyword does not relate to any type, it cannot be used barely in expressions which require a type, like variable initilizer or array's first element. However, it's possible to cast the null to a type, using the as operator.

Last edited Mar 14, 2011 at 9:13 PM by impworks, version 1


No comments yet.