Note that of those two options mentioned in the first post, they do
not work exactly the same, and the second one is potentially more efficient!
The && operator in
Java is a short-circuit operator. That means that if you write A && B and A is true, then Java already knows that the answer to the expression A && B is true, so it is not going to evaluate B.
In your first example, the JVM is going to evaluate all three expressions first, and after that it combines them in the if-statement. Note that all three expressions are always evaluated, regardless of which ones are true or false.
In your second example, the JVM evaluates the first expression and stops if it is true (it doesn't need to evaluate the second and third expression).