Expressions in Java are very much like in other programming languages. You can use the operators that may be similar from languages such as C or C++. They are as follows:
- Unary prefix and postfix increment operators ( -- and ++ before and after a variable)
- Unary sign (+ and -) operators
- Logical (!) and bitwise (~) negation
- Multiplication (*), division (/), and modulo (%)
- Addition and subtraction (+ and - again, but this time as binary operators)
- Shift operators move the values bitwise, and there is left (<<) and right (>>) shift and unsigned right shift (>>>)
- The comparing operators are <, >, <=, >=, ==, != and instanceof that result in boolean value
- There are bitwise or (|), and (&), exclusive or (^) operators, and similarly ...