I don’t understand the meaning of “except that E1 is evaluated only once”

I often quoted the following phrase from JLS:

The expression for compound assignment of the form E1 op = E2 is equivalent to E1 = (T) ((E1) op (E2)), where T is the type E1, except that E1 is evaluated only once.

However, I do not understand the meaning of "except that E1 is evaluated only once." In which scenario is "E1" rated twice?

+4
source share
1 answer

If it really was

 E1 = (T)((E1) op (E2))

E1 - , , , . E1 , , . ( , , , , , , , - , , , , !)

 E1 op= E2

E1 , , AND, . ( , , E1 .) , , , , .

+2

Source: https://habr.com/ru/post/1525986/


All Articles