Original Post
Is it possible with Java? I heard there was a way with the >>> operator, but I never understood how its done. Can anyone provide any code samples? Thanks. Edit: I looked in my book and it's something like this... The following code fragment demostrates the >>>. Here, a is set to -1, which sets 32 bits to 1 in binary. The value is then shifted right 24 bits, filling the top 24 bits with zeros, ignoring normal sign extension. This sets a to 255. int a = -1; a = a >>> 24; 11111111 11111111 11111111 11111111 // -1 in binary as an int >>>24 00000000 00000000 00000000 11111111 // 255 in binary as an int [Edited by - dxFoo on August 28, 2005 1:55:21 PM]