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

jQuery clickable div with working mailto link inside -

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -