java - if (a != null && a instanceof A) ... or if (a instanceof A) -
for following conditionals:
if (a != null && instanceof a) or
if (a instanceof a) is there advantage (for example, performance-wise) check null first? both conditionals should equal in result.
no advantage whatsoever, can
if(a instanceof a) {} this return evaluate false if null
Comments
Post a Comment