Turn Desktop View Off
by Dinesh Thakur

The bitwise AND, OR, and XOR operators (&, |,and /\) all act on the individual bits of an integer. These operators are useful when an integer is being used as a bit field.

Here is the Java Example for Bitwise AND, OR, and XOR Operators

class  BitwiseANDORXOROperators 

{
            public  static  void  main  (String  args[ ] )
            {
                        int  x  =  13,  y  =  10;
                        System.out.println("x   =  "  +  x);
                        System.out.println("y  =  "  +  y);
                        System.out.println("x  &  y  =  "  +  (x  &  y) ) ;
                        System.out.println("x  |  y  =  "  +  (x  |   y) ) ;
                        System.out.println("x  ^  Y  =  "  +  (x  ^  y) ) ;
            }
}

Bitwise AND, OR, and XOR Operators