In Java,
Thank you for printing the precedence
our content of * is higher than
at [Link]. that
Please of back
check - . soon for new
contents.
Hence, the multiplication is performed before subtraction,
and the value of myInt will be 4.
Learn to code solving problems with our hands-on Java course! Try ([Link]
Programiz PRO today. java)
SearchPRO
Programiz ([Link]
tutorials & examples
(/)
Operator Precedence Table
[Link]
The table below lists the precedence of operators in Java;
higher it appears in the table, the higher its precedence.
Java Operator Precedence
Operators Precedence
postfix increment and
++ --
decrement
prefix increment and
++ -- + - ~ !
decrement, and unary
multiplicative * / %
additive + -
shift << >> >>>
relational < > <= >= instanceof
equality == !=
bitwise AND &
bitwise exclusive OR ^
bitwise inclusive OR |
logical AND &&
logical OR ||