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

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -