- Home /
what is null
what is null.
Comment
Best Answer
Answer by CHPedersen · Oct 17, 2011 at 07:01 AM
null is the value of a reference variable when it doesn't point to anything in memory. Think of it as a street sign with the name of a city on it, but no arrow, and the city doesn't exist. ;)
You can compare against it in if-sentences to see if objects have been instantiated yet. Objects are null up until the point someone instantiates them using the "new" keyword:
object test; // null
test = new object(); // No longer null, points to an actual object
Read more here: