java difference 2b 2bi and i 2b 2b loop

Solutions on MaxInterview for java difference 2b 2bi and i 2b 2b loop by the best coders in the world

showing results for - "java difference 2b 2bi and i 2b 2b loop"
Sara
06 Jan 2020
1//no difference in a loop.
2for (int i = 0; i < 100; i++) {
3}
4
5for (int i = 0; i < 100; ++i) {
6}
7//however when doing:
8int a = 0;
9int b = a++; // b = 0; a = 1
10
11a = 0;
12b = ++a; // b = 1; a = 1
13