z
# Java Operators

## Types of operators

## List of Operators and Their Precedence

Java derives many feature from C language(mother of programming language). Like C and C++ , java provide a large collection of operators to work on variables.

It also provides many new operators to work with like conditional operators(? : ) and instanceOf operator

Precedence in operator decides in expression which two operands are calculated first , it define how an whole expression is evaluated.

Associativity | Operator Category | Operator Symbol |
---|---|---|

Left to right | Postfix | () [] . (dot operator) |

Right to left | Unary | ++ - - ! ~ |

Left to right | Multiplicative (Arithmetic Operator) | * / % |

Left to right | Additive (Arithmetic Operator) | + - |

Left to right | Shift (Bitwise Operator) | >> >>> << |

Left to right | Relational (Relational Operator) | > >= < <= |

Left to right | Equality (Relational Operator) | == != |

Left to right | Bitwise AND | & |

Left to right | Bitwise OR | | |

Left to right | Bitwise XOR | ^ |

Left to right | Logical AND | && |

Left to right | Logical OR | & |

Right to left | Assignment | = += -= *= /= %= >>= <<= &= ^= |= |

Right to left | Conditional | ?: |