hai, i want why the output is different in java for the below code --- int a=2; a=a++; System.out.println(a); --- the output is 2 why &how the code is executed(i want some algor) thank u srinivasan.e
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
It's because the expression a++ is evaluated after the assignment. a is assigned a and then a is increased by 1. Instead use only the statement a++ or a=++a instead.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.