views:

37

answers:

2

From what I have read it seems postfix increment and decrement operators have higher precedence over prefixed ones, but in an expression where both are being used the prefix gets evaluated first. I am reading from SCJP A comprehensive Khalid. Any recommendation on resources for clearly understanding operators and assignment in java would be helpful.

A: 

Because that's how prefix operators work. They are defined by the language to occure before postfix operators. The precidence has nothing to do with it.

Burton Samograd
Doesn't your third sentence directly contradict your second sentence?
Tony Ennis
A: 

Not correct. They have the same precedence. See the Java grammar. However of course pre-increment is evaluated before post-increment. That's what the words mean.

EJP