Java programming.
int i = 0;
int j = 1;
str.charAt(i) ^ str2.charAt(j)
What does mean ^ operator in java? And what is this operator reverse operation? example w ^ . = 121 T ^ W = 35
Java programming.
int i = 0;
int j = 1;
str.charAt(i) ^ str2.charAt(j)
What does mean ^ operator in java? And what is this operator reverse operation? example w ^ . = 121 T ^ W = 35
The bitwise ^
operator performs a bitwise exclusive OR operation.
Applied, this does:
false ^ false = false
false ^ true = true
true ^ false = true
true ^ true = false
When it comes to integer varibles (including the type char
) the numbers are converted to their binary representation and then the operator takes place. For example:
3 ^ 5 = 011 ^ 101 = 110 = 6
^
indicates Binary XOR
Operator copies the bit if it is set in one operand but not both.
Truth Table For XOR