Introduction

Operators are unique symbols in Java. These operators do specific tasks in Java. These operators follow an order of precedence and associativity in Java. In Java, operators with lower precedence are operated after the operators with higher precedence.

Operators in Java

Arithmetic Operators

Relational Operators

Bitwise Operators

Boolean Logical Operators

Order of Precedence and Associativity

Associativity Operators
L to R () []
R to L ++ -- + - ! ~
L to R * / %
L to R + -
L to R << >> >>>
L to R < <= > >=
L to R == !=
L to R &
L to R ^
L to R |
L to R &&
L to R ||
R to L ? :
R to L = += -= *= /= %= &= ^= |= <<= >>= >>>=

Summary

This article has explained the operators and their order of precedence and associativity in Java.