I think the example mentioned by you will throw a NullpointerException ( Runtime) , since in the system.out.println you are trying to use a reference variable not referring to any object. ( Its having null value).
i think it doesnt throw a null pointer exception because you are converting a null object a string object in system.out.println(); statement so it compiles and runs correctly
Actually it doesn't throw NullpointerException. Indeed the null is first concatinated with "" string. After that when null has been concatinated to "" String then it convert the null+"" into String with toString() method. So if we convert null+"" into String, no reason for NullpointerException.
Regards.
Pomy
IBM Certified WebSphere Commerce Application Developer