Java Logical Operators: Guide with Examples, Short-Circuit Evaluations - Quiz
Total: 1 questions
1. The feature of the short-circuit operators.
The feature of the short-circuit operators.
The short-circuit of the && and || operators don't waste time on pointless evaluations. A short-circuit && evaluates the left side of the expression first (operand one), and if it resolves to false, the && operator doesn't evaluate the right side of the expression. The || operator is similar to the && operator, except that it evaluates to true if ONE of the operands is true. If the first operand in an OR operation is true, the result will be true, so the short-circuit || doesn't waste time looking at the right side of the equation.
Page 1 of 1