System.out.println(i + 4); for (i = 0; i < 10; i++);.
The result for (i = 0; i < 10; i++);will be 10. The condition i < 10will be true before i=9, which is the 10th iteration, and in the 11th iteration it iwill be 10as it will i++, and here the condition i<10will fail. Now the final value iwill be 10. The following statement is calculated System.out.println(i + 4);, which is equal toi(=10)+4 = 14
source
share