Sunday, August 21, 2011

BitwiseOperator in java


//BitwiseOperator in java
class BitwiseOperator
{
    public static void main(String arg[])
      {
           int a=3,b=5,c=-8,d=-2;
           System.out.println("a&b=  "+(a&b));
           System.out.println("a|b=  "+(a|b));
           System.out.println("a^b=  "+(a^b));
           System.out.println("~a=  "+~a);
           System.out.println("a<<1=  "+(a<<1));
           System.out.println("d<<2=  "+(d<<2));
           System.out.println("c>>2=  "+(c>>2));
           System.out.println("c>>>2=  "+(c>>>2));
      }
}

Previous Next Home
0 Comments
Comments

Leave a Comment

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

Twitter Delicious Facebook Favorites More