Expressions. As illustrated in the table at the bottom of the previous page, typical expressions
are infix: a literal (or an expression), followed by an operator, followed by
another literal (or another expression). When an expression contains more than one
operator, the order in which they are applied is often significant, so the following precedence
conventions are part of the Java language specification: The operators * and / (
and %) have higher precedence than (are applied before) the + and - operators; among
logical operators, ! is the highest precedence, followed by && and then ||. Generally,
operators of the same precedence are applied left to right. As in standard arithmetic expressions,
you can use parentheses to override these rules. Since precedence rules vary
slightly from language to language, we use parentheses and otherwise strive to avoid
dependence on precedence rules in our code.