java - Infinite loop value -


what initial values of x make loop infinite? told answer 123, don't understand how. can explain this?

do  {    x = x - 3; }  while (x < 120); 

no value cause loop infinite loop. in java, integral primitive values underflow positive number, , loop end.

as example:

int x = integer.min_value;  {     x = x - 3;      system.out.println(x); } while (x < 120);  

will output:

2147483645 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -