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

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

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

unit testing - How to mock PreferenceManager in Android? -