detecting the nullpointer

hello how can i detect null pointer simply?
[50 byte] By [netsonicca] at [2007-10-3 5:26:01]
# 1
if (reference == null) System.out.println("Nothing to see, move along.");
CeciNEstPasUnProgrammeura at 2007-7-14 23:33:15 > top of Java-index,Java Essentials,Java Programming...
# 2
> hello how can i detect null pointer simply?check the reference causing the nullpointerexception.Example: if someobject.somemethod() is causing a nullpointerexception, check if someobject != null before calling somemethod() on it.
aniseeda at 2007-7-14 23:33:15 > top of Java-index,Java Essentials,Java Programming...