class Shift {
    public static void main(String args[]) {
        int a = 3;   // 16進数の 0x00000003
        int b = -4;  // 16進数の 0xFFFFFFFC
        int c, d;
        
        c = a << 1;  // 左シフト
        System.out.println( "a = "+a+",  Left shift(1 bit) = "+c);
        
        c = b >> 2;  // 右算術シフト
        System.out.println( "b = "+b+", Right arithmetic shift(2 bits) = "+c);

        c = b >>> 2;  // 右論理シフト
        System.out.println( "b = "+b+", Right logical shift(2 bits) = "+c);
        
        d = 256 * 256 * 256 * 63 + 256 * 256 * 255 + 256 * 255 + 255;
        System.out.println( "d = "+d);
     }
}        