byte in Java is signed 8-bit twos' complement - so the -1 as a byte is eight 1s , ie. 11111111.
the char and int casts are meaningless, so you end up with an int (which in Java is 32-bit signed two's complement, giving the positive decimal result of 65535.
-1 --> Byte (1) --> Char (Some Weird Character) -- > Int --- > 65535.
-1 --> Byte -- > -1
-1 --> Char --> 'ï¿¿'
'ï¿¿' --> Int - > 65535