This week's book giveaway is in the OCAJP forum. We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line! See this thread for details.
Or to paraphrase to a slightly more readable version:
No difference, just relies on the fact that things are easier to understand if you don't have to get your head around a negation first... Dave
posted 14 years ago
booleanTest ? expression1 : expression2 This is the only ternary operator in Java. As already expressed, it's a shorthand if-else construct. If the boolean test is true, then the first expression is evaluated and returned; otherwise the second expression is evaluated and returned.