public class Bitwise {

  public static void main(String[] args) {
    
    int a = 2;
    int b = 6;
    int c = a & b;
    System.out.println(c);

    a = 2;
    b = 4;
    c = a | b;
    System.out.println(c);

    a = 3;
    b = 6;
    c = a ^ b;
    System.out.println(c);
    int d = c ^ b;
    System.out.println(d);

    a = 0;
    b = ~a;
    System.out.println(b);


    //Shift Operators
    a = 4;
    b = a << 2;
    System.out.println(b);

    a = -126;
    b = a >> 1;
    System.out.println(b);

    a = -1;
    b = a >>> 31;
    System.out.println(b);

    
  }
}