Image

Imagevaduha wrote in Imagejava_dev

i += i++ + ++i; VS i++; i += i++ + i;

via http://www.livejournal.com/community/ru_java/150455.html

Can you explain why

int i = 1;
i += i++ + ++i;


is not equivalent to:

int i = 1;
i ++;
i += i++ + i;


UPD: By the way, C++ code (on MS Vstudio 6.0 and g++ under Linux) gives the same result in the both cases - "7".