answersLogoWhite

0


Best Answer

The XOR operator is the carat character: ^

Example:

// Create character
char ch = 'a';
System.out.println(ch);

// Perform XOR
ch = (char)(ch ^ 86);
System.out.println(ch);

// Perform XOR...again
ch = (char)(ch ^ 86);
System.out.println(ch);

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you perform the xor operation for character in Java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between the or logical operator and the Xor operator?

The or operator will evaluate to true if either side of the operation is true.The xor operator will evaluate to true only if exactly one side of the operation is true.This means that these two operators will evaluate equally for all cases except when both sides of the operations are true.true or true -> truetrue xor true -> false


What is the use of bitwise operator in c plus plus?

They perform bitwise operations like AND (&), OR (|), XOR (^) and NOT (~).


What operation will applied to compliment middle 8 bits of 16 bit value 1001101011001101?

XOR 0000111111110000


Operation of XOR gate?

An XOR (exclusive OR gate) has two inputs and one output. If only one of the inputs is at level 1, then the output is 1 otherwise the output is 0. The truth table looks like this: A B Out0 0 00 1 11 0 11 1 0 Exclusive OR represents in logic what "or" means in English; for example, if asked if you want tea or coffee it's usually meant that you can have one or the other - not both.


All the bitwise operators have the same level of precedence in Java true or false?

False: highest precedence & bitwise AND ^ bitwise XOR | bitwise OR lowest precedence


How can you represent XOR function symbol in word?

xor


How do you represent assignment by bitwise XOR operator?

The bitwise XOR operator is ^, or shift 6. The bitwise XOR assignment operator is ^=.


What is XOR in a c program?

a XOR b is a^b in C language


What is the Java logical operators that has the highest order of preference?

"The following" doesn't make sense if you don't include a list. You can find a list of Java operators, including their precendence, at http://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html. Or search for [java operator precedence] for additional places that explain this topic.


What are the functions of accumalater?

In computers, an accumulator is an 8-bit register that is a part of ALU (Arithmatic-Logic Unit) of a processor.It is used for temporary storage of 8-bit data and to perform arithmatic operations like addition,subtraction,multiplication,division or logical operations like AND,OR,XOR etc.The result of operation is stored in accumulator.


Is xor gate is derived gate?

yes... xor is derived gate from primary gates


Prove that XOR and AND gates form universal set?

If you're allowed to prove this the easy way (by showing you can use XOR and AND to create the set of AND, OR, and NOT), this is pretty straightforward. x AND y = x AND y (of course) x OR y = (x XOR y) XOR (x AND y) NOT x = x XOR 1 Also, (x AND y) XOR 1 is equivalent to x NAND y, which is a universal gate.