Compound Boolean Expressions

The logical operators !, &&, and || build one Boolean expression out of smaller ones. A phone's lock screen, which accepts a face match or a PIN, uses all three.
Three operators
boolean faceMatch = false;
boolean pinCorrect = true;
boolean unlocked = faceMatch || pinCorrect;
boolean bothChecks = faceMatch && pinCorrect;
boolean stillLocked = !unlocked;
One of the two checks passed, and for || one is enough, so unlocked is true. The && needs both, so bothChecks is false. The ! reverses its operand, and stillLocked is false.
Comparisons as operands
An operand can be any expression with a Boolean value, including a comparison. The phone shows a warning while the count of failed tries is from 1 through 5.
int tries = 3;
boolean warn = tries >= 1 && tries <= 5;
Both comparisons are true, so warn is true. The shorthand from mathematics, 1 <= tries <= 5, doesn't compile. Java evaluates 1 <= tries first, gets a boolean, and can't compare a boolean with 5.
Precedence
The lock screen has a rule: after 5 failed PIN tries, it stays locked. Here is a first attempt at the condition.
boolean opens = faceMatch || pinCorrect && tries < 5;
Since && is applied before ||, Java reads it as faceMatch || (pinCorrect && tries < 5). A face match then opens the phone however many tries have failed. If the rule is meant to cover the face match as well, the parentheses have to say so.
boolean opens = (faceMatch || pinCorrect) && tries < 5;
The two lines use the same operands and operators, and only the grouping differs.
A ! applies to the single operand right after it. So !faceMatch && pinCorrect means (!faceMatch) && pinCorrect, and a negation meant for a whole expression needs its own parentheses, as in !(faceMatch && pinCorrect).
Stopping early
If the left operand of && is false, the whole expression is false, so Java doesn't evaluate the right operand. If the left operand of || is true, the whole expression is true, and again the right operand is skipped.
Suppose the static method Pin.check(entry) prints Checking PIN and returns whether the entry is correct.
boolean opens = faceMatch || Pin.check(entry);
With a face match, faceMatch is true, the whole expression is already true, and nothing is printed, because Pin.check is never called. Without one, the method runs and its line appears. The same rule lets a left operand protect a right operand that would fail, such as a division by a count that might be 0.