
class Sign {
 public static void main(String[] args) throws InterruptedException
 {
    char  u = 0x8200;            //16-bit unsigned number
    short s = (short) 0x8200;    //16-bit signed number

    u >>= 1;                     //right-shift one bit
    s >>= 1;                     //right-shift one bit

    int ui = 0x0000ffff & u;     //take lower 16 bits of u
    int si = 0x0000ffff & s;     //take lower 16 bits of s
    System.out.printf("\nunsigned shift:  0x%x", ui );
    System.out.printf("\nsigned shift:    0x%x\n", si );
 }
}
