Codecore Logo
Quick Search
»
Advanced Search »

Null Reference

RSS
The null keyword is a literal that represents a null reference, one that does not refer to any object.

The null keyword represents "no value," meaning "nothing," not even an empty string or zero. It can be used to initialize a variable to have no value or to clear the value of a variable, so that there is no longer any data associated with that variable, and the memory used by it is freed. When a variable is assigned null, it does not contain any valid data type.

Null Assignment Example:


x = null;

Null Comparison Example:


if ( x != null )
{
    x.doSomething();
}
Privacy Policy | Conditions Of Use

Copyright ©2014 Codecore Technologies, All rights reserved.