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

rdbms - what exactly the undo information lives in oracle? -

bash - How do you programmatically add a bats test? -

clojure - 'get' replacement that throws exception on not found? -