Which one is faster:
Either this
try {
n.foo();
}
catch(NullPointerException ex) {
}
or
if (n != null) n.foo();
Which one is faster:
Either this
try {
n.foo();
}
catch(NullPointerException ex) {
}
or
if (n != null) n.foo();