The Bitwise Operators in Java

The bitwise operators available in Java can be easily applied to a number of data types. These data types include byte, short, long, int and char. Typically, any bitwise operator performs the concerned operation bit-wise. For instance, if you consider the example of an integer x, which has the value 60. Therefore, the binary equivalent of x is 00111100. Consider another variable y, with the value 13 or 00001101. If we perform the bitwise operation & on these two numbers, then you will get the following result:

x&y = 0000 1100

The table shown below shows a list of bitwise operators that are available in Java.

Screenshot from 2020-08-24 10-20-27


For any query or issue, feel free to discuss on http://discuss.eduguru.in