Before calling a function of an object, I need to check if the object is null, to avoid throwing a NullPointerException.
NullPointerException
What is the best way to go abou
if you do not have an access to the commons apache library, the following probably will work ok
if(null != foo && foo.bar()) { //do something }