I'm confused about a table showing operator precedence. The table is found in this CodeGym article
Why does

`expr++`

have more precedence than `++expr`

? I thought that `++expr`

increments first and foremost, whereas `expr++`

updates its value AFTER being used in the operation. Does anyone understand this?
For instance:
```
int a = 2;
int b = 3;
int c = ++a + b--;
System.out.println(c); // c prints 6
System.out.println(b); // b prints 2
System.out.println(a); // a prints 3
```

If **postfix**(`expr++`

) has the highest precedence, as shown in the table, then why does the expression `++a`

(which has lower precedence) increment the value first? If the postfix expression `b--`

has the maximum precedence, then why does the value of `b`

increment **after**the operation has taken place?
The value of the postfix increment expression is the value of the variable before the new value is stored.In a case like here: a is incremented to 2. But the expression a++ still is evaluated to the old value of a which is 1. In the end b is 11 and a is 2. If you want the expression a++ to evaluate to 2, then you need to use prefix. That uses as value for the expression ++a the value of a after incrementing it (or just use a + 1)aandb, their values would be 5 and 1 respectively. The next step would be to evaluate the prefix urinary variables which first increments the variable by 1 and then sets the value in the equation, also starting from left to right. So after this step the equation would look like this: And the result would be 6.ais evaluated after the expression then you would get the answer of 8; however if you run the code you will see that 9 is printed forresult. Once again this is because the total expressiona++is evaluated completely before moving to the next step. This would mean the value 4 is plugged into the overall equation and thenais incremented by 1. After that first step the equation would look like this: The value ofaat this point is now 5 so that would be plugged in for the remaininga: and then 4 + 5 would evaluate to setresultto 9.