I have this code...
for(int i=0; i<10 ; ) {
i = i++;
System.out.println("Hello World");
}
Output:
Hello World
Hello World
Hello World...
The loop will repeat infinitely, because i remains 0 after every iteration of the loop.
I thought this expression i = i++; was redundant... like this one i=(i=i+1);, but it remains 0 so how does it work?