Precedence of Java Operators
More often than not, operators are used in combinations in expressions. However, you
must have also realized that it becomes difficult to predict the order in which operations
will take place during execution. The operator precedence table for Java shall help you
predict operator operations in an expression deduction. For instance, if you are performing
addition and multiplication in the same expression, then multiplication takes place prior to
addition. The following table illustrates the order and hierarchy of operators in Java. The
associativity for all the operators is left to right. However, the unary, assignment and
conditional operator follows right to left associativity.
Do'stlaringiz bilan baham: |