• Home
  • Docker
  • Kubernetes
  • LLMs
  • Java
  • Ubuntu
  • Maven
  • Big Data
  • Archived
Java | Java Operators
  1. Notes
  2. Simple Assignment Operator
  3. Arithmetic Operators
  4. Unary Operators
  5. Equality and Relational Operators
  6. Conditional Operators
  7. Bitwise Operators
  8. Bit Shift Operators
  9. Type Comparison Operator
  10. Operator Precedence

  1. Notes
    Short-circuit evaluation: means that the right hand side of the expression won't be evaluated if it isn't necessary.
  2. Simple Assignment Operator
  3. Arithmetic Operators
  4. Unary Operators
  5. Equality and Relational Operators
  6. Conditional Operators
  7. Bitwise Operators

    Java Samples:
    • Unary bitwise complement:

    • Bitwise AND:

    • Bitwise inclusive OR:

    • Bitwise exclusive OR:
  8. Bit Shift Operators

    Java Samples:
    • Signed left shift:


    • Signed right shift:

  9. Type Comparison Operator
  10. Operator Precedence
    Associativity "Left to right": x = a / b * c can be written x = (a / b) * c
    Associativity "Right to left": a += b -= c can be written a += (b -= c)

    Operator Description Associativity
    []
    .
    ()
    Array element access
    Object member access
    Method call
    Left to right
    ++
    --
    Post increment
    Post decrement
    !
    ~
    ++
    --
    +
    -
    ()
    new
    Logical NOT
    Bitwise NOT
    Pre increment
    Pre decrement
    Unary plus
    Unary minus
    Cast
    Instantiation
    Right to left
    *
    /
    %
    Multiplication
    Division
    Remainder
    Left to right
    +
    -
    +
    Additive
    Subtraction
    String concatenation
    Left to right
    <<
    >>
    >>>
    Signed left shift
    Signed right shift
    Unsigned right shift
    Left to right
    <
    <=
    >
    >=
    instanceof
    Less than
    Less than or equal to
    Greater than
    Greater than or equal to
    Type Comparison
    Left to right
    ==
    !=
    Equal to
    Not equal to
    Left to right
    & Bitwise AND Left to right
    ^ Bitwise XOR Left to right
    | Bitwise OR Left to right
    && Conditional AND Left to right
    || Conditional OR Left to right
    ?: Ternary Right to left
    =
    +=
    -=
    *=
    /=
    %=
    &=
    |=
    ^=
    <<=
    >>=
    >>>=
    Right to left
© 2025  mtitek