A shift operator performs bit manipulation on data by shifting the bits of its first operand right or left. The bitwise operators are the operators used to perform the operations on the data at the bit-level. When we perform the bitwise operations, then it is also known as bit-level programming. It consists of two digits, either 0 or 1.
Operator | Description |
---|---|
| | Bitwise OR |
& | Bitwise AND |
^ | Bitwise XOR |
~ | Bitwise complement |
<< | Left shift |
>> | Signed right shift |
>>> | Unsigned right shift |
public class Bitwise { public static void main(String args[]) { //Bitwise & Shift Operators in Java int a=25,b=45; System.out.println("Bitwise And : "+(a&b)); System.out.println("Bitwise Or : "+(a|b)); System.out.println("Bitwise Xor : "+(a^b)); System.out.println("Bitwise Not : "+(~a)); } }
Bitwise And : 9 Bitwise Or : 61 Bitwise Xor : 52 Bitwise Not : -26To download raw file Click Here
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions