Which one is faster:
Either this
try { n.foo(); } catch(NullPointerException ex) { }
or
if (n != null) n.foo();
The if construct is faster. The condition can be easily translated to machine code (processor instructions).
The alternative (try-catch) requires creating a NullPointerException object.