Java Precedence Mnemonic

Have trouble memorizing Java Operator Precedence? Fear no more! I have one for you!

Parents After Pre-Algebra Shifts (and) Compares Equations (and) answers, (eat) carrots, or (simply) bite logs if (a teacher gives an) assignment.

Mnemonic Operator Type Direction of Evaluation
Parents () [] · Parentheses Array subscript Member selection
After ++ – Unary post-increment Unary post-decrement
Pre ++ — + – ! ~ ( type ) Unary pre-increment Unary pre-decrement Unary plus Unary minus Unary logical negation Unary bitwise complement Unary type cast
Algebra * / % Multiplication Division Modulus
—- + - Addition Subtraction
Shifts << >> >>> Bitwise left shift Bitwise right shift with sign extension Bitwise right shift with zero extension
Compares < <= > >= instanceof Less than Less than or equal Greater than Greater than or equal Type comparison (objects only)
Equations (Equally) == != Is equal to Is not equal to
Answers (ANDsers) & Bitwise AND
Carrots ^ Bitwise exclusive OR
Or | Bitwise inclusive OR
—Bite Logs— && Logical AND
–Bit (then) logical– || Logical OR
If ? : Ternary conditional
Assignment = += -= *= /= %= Assignment Addition assignment Subtraction assignment Multiplication assignment Division assignment Modulus assignment

See the original (unmodified) table