is a "short-circuit" boolean operation. So if the first (left-to-right) expression evaluates false, the second expression is not evaluated since false and true evaluates false.
evaluates both expressions regardless. This is significant if your code depends on the second expression being evaluated or not.
if ( (1 > 2) && deleteAllMyFiles() ) { System.out.println("This can never happen"); }
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
which still gets a null pointer exception when a is null. They intended a shortcut && in there to make that work. Being a PITA I changed it to:
if ( "b".equals(a) ) ...
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi