java - Import some code so that loop become infinite? -


make loop infinite .add line

public class puzzel4 {     public static void main(string[] args) {         // place declaration here         while (i != 0) {             >>>= 1;         }     } } 

byte i=-1;  

from comments:

unsigned right-shifting, in java, causes unary promotion int: byte 0xff becomes int 0xffffffff, right-shifted 0x7fffffff , narrowed 0xff storage.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -