for what reason would you need to do this when you can just say (int i = 0; i < 10; i++)
– BaneDadJul 31 '17 at 21:06
This is infinite. You, every time, resetting i to 0 after each for iteration. YOu can test below code for understanding. ` for(int i=0; i<10; ) {
i = i++;
System.out.println(i);
}`
– Uddhav P. GautamJul 31 '17 at 21:09
Because `i = i++;` should just be `i++;`. If you tried to do `for (int i=0; i<10; i = i++)` you would have the same problem, for reasons explained in the duplicate question.
– Sean Van GorderJul 31 '17 at 21:20