java - Quick question on If statements with multiple conditions -


possible duplicate:
&& (and) , || (or) in java if statements

this question should have known answer years ago if writing if statement in java has if(x != null && y == null && x.equals(z)) safe? assume if statement conditions interpreted left right checking if x != null begin assure no null pointer exception thrown (at least x) on x.equals(z) part of condition. accurate?

yes. it's called short-circuited logic: http://en.wikipedia.org/wiki/short-circuit_evaluation.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -