[Java] public class InTheLoop {public static final int END = Integer. MAX_VALUE; public static final int BEGIN = END-100; public static void main (String [] args) {int count = 0; for (int I = BEGIN; I <= END; I ++) {count ++;} System. out. println (count) ;}} what will the above Code output? If you do not take a closer look, you may think it is 100. Because the loop is 100 times, but you can see that this loop is not a typical practice, so you think the output should be 101. Actually none. If you do not manually stop the program, it will continue to run. What is the root cause of the problem? The problem is that in the Condition of the for loop, I <= END, that is, I <= Integer. MAX_VALUE. When the loop reaches 100 times, I = Integer. MAX_VALUE, the next cycle I ++, Because I is of the int type, overflow occurs, I = Integer. MIN_VALUE, of course, is smaller than END, so I keeps increasing to Integer. MAX_VALUE, and then overflow into Integer. MIN_VALUE. So the problem is that the int type indicates that the range is too small in this case. You can change the I type from int to long. [Java] www.2cto. compublic class InTheLoop {public static final int END = Integer. MAX_VALUE; public static final int BEGIN = END-100; public static void main (String [] args) {int count = 0; for (long I = BEGIN; I <= END; I ++) {count ++;} System. out. println (count) ;}} in this way, you will soon get the 101 answer. The lesson for Language designers is that it should support arithmetic operations that do not throw exceptions when overflow occurs.