System.out.println(null);//will result in a compiler error
The compiler is unable to decide which method to call println(char[]) or println(String). Or in the words of the compiler "reference to println is ambiguous".
But in this case the compiler cannot determine the value being printed. The actual method call (call to toString()) is deferred until runtime. The first call returns null and the JVM is unable to decide which println to call and hence it throws a NullPointerException.
I think this is the case.But I am not sure about it??