java - Why is this an infinite loop? -
possible duplicate:
java problem-whats reason behind , probable output
int i=0; for(a=0;a<=integer.max_val;a++) { i++; } system.out.println(i); why result in infite loop?
every possible integer <= integer.max_value.
condition in for loop can never false.
when a reaches max_value, a + 1 overflow , wrap around min_value.
Comments
Post a Comment