posted 23 years ago
In Khalid book review question 3.7,
int k=1;
int i = ++k + k++ + + k;
System.out.println(i);
Answer is the "++k + k++ + + k" expression is parsed as ( (++k) + (k++) ) + (+k) ->((2) +(2) +(3)). Shouldn't (k++) evaluated before (++k) since postfix operator has higher precedence than prefix operator? Shouldn't it be ( (3)+(1)+(3))?
Thanks.
Judy