Sasha,
Your examples don't compile in
Java.
If the program terminates with a NullPointerException, then something was the null reference, and it was asked to do something.
If you wanted to test whether an object reference refers to null, then
if (myRef == null) would be an appropriate strategy.
As previously mentioned, the compiler will catch uninitialized variables.
[ November 27, 2003: Message edited by: Dirk Schreckmann ]