I think the key point this example is showing is that
null is a valid reference value. That is, you can assign null to an object reference variable in the same way you assign an object reference.
Object obj = new Object()
and
Object obj = null
Are both valid assignements. Additionally, casting a reference that contains a null value is allowed as long as the types of the variables allow the cast; The System.out.println() method also deals ok with null values, printing "null" .
The only time you will actually get a null pointer exception is if you try to call a method or access an instance member from a reference variable that has a value of null.
For example,
String str = "hi";
System.out.println(str.toString()); //this prints "hi"
String str2 = null;
System.out.println(str2.toString()); //this will give a null pointer exception.
Rob