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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -