Java-Bitwise NOT

Bitwise NOT( ~ ) The Bitwise NOT is represented by the symbol (~) . Bitwise NOT is an unary operator and inverts all the bits represented by its operand. That is, 0s become 1s and 1s become zero. Program Program Source public class Javaapp { public static void main(String[] args) { byte a = 3; byte b = … Read more…

Java-Bitwise Exclusive OR

Bitwise Exclusive OR( ^ ) The bitwise exclusive OR is represented by the symbol (^). The result of exclusive OR is 1 if only one bits of the bits is 1; otherwise it is zero. Program Program Source public class Javaapp { public static void main(String[] args) { int a = 10; int b = 12; int … Read more…

Java-Bitwise OR

Bitwise OR( | ) The Bitwise OR, is represented by the symbol | (vertical bar) and is surrounded by two integer operands. The result of OR operation is 1 if at least one of the bits has a value 1; otherwise it is zero. Program Program Source public class Javaapp { public static void main(String[] … Read more…

Java-Bitwise Operators

Bitwise Operators Java has a distinction of supporting special operators known as bitwise operators for manipulation of data at values of bit level. Bitwise operators can be applied to the interger types, byte, char, short, int and long. Bitwise operators may not be applied to float or double. Bitwise AND(&) The bitwise AND operator is … Read more…