Java Operators
In this chapter you will learn:
Four groups of Java operators
Java operators can be divided into the following four groups:
- arithmetic,
- bitwise,
- relational,
- logical.
Operators are classified as prefix, postfix, and infix.
- A prefix operator is a unary operator that precedes its operand, for example -6.
- A postfix operator is a unary operator that trails its operand, for example x++.
- An infix operator is a binary or ternary operator that is placed between the binary operator's two or the ternary operator's three operands, for example x + 5.
Java Operator Precedence
The following table shows the order of precedence for Java operators, from highest to lowest.
- () [] . (Highest)
- ++ - - ~ !
- * / %
- + -
- > >>> << ]]>
- >= < <= ]]>
- == !=
- ^
- |
- ||
- ?:
- = op= (Lowest)
Next chapter...
What you will learn in the next chapter:
- Use Java Arithmetic Operators to do calculation
- How to use basic arithmetic operators to do calculation
- How to use modulus operator to get the remainder of a division operation
- How to use arithmetic compound assignment operators
- How to use Java increment and decrement operators
Home » Java Tutorial » Operators Statements