About Operator Precedence In Java :
Operator precedence plays an important role if there are multiple operators involved in an expression. int a = 7 * 3 + 24 / 3 - 5; * and / have more precedence (or priority) compared to + and - . So first 7 * 3 and 24 / 3 is evaluated and then the results are added.
// a = 7 * 3 + 24 / 3 - 5; ( ) to avoid any confusion.
int a = 7 * 3 + 24 / 3 - 5; // Creates confusion - Not suggested.
|