Explain the following with an example segment: Bitwise Characters
Advertisements
प्रश्न
Explain the following with an example segment:
Bitwise Characters
कोड लेखन
स्पष्ट करा
Advertisements
उत्तर
Bitwise Characters in Java refer to the symbols used as bitwise operators to perform operations on individual bits of integer values. These operators work on the binary representation of numbers.
The main bitwise operators are AND (&), OR (|), XOR (^) and NOT (~).
Input Example:
int a = 5, b = 3;
System.out.println(a & b);
System.out.println(a | b);
System.out.println(a ^ b);
Output:
1
7
6
7
6
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 6: Variables and Expressions - EXERCISE [पृष्ठ १३१]
