Java BigInteger xor() MethodThe xor() method of Java BigInteger class is used to find the Bitwise XOR of two BigIntegers. This method returns a BigInteger whose value is (this ^ val). Syntax:Parameter:val - value to be XOR'ed with this BigInteger. Returns:This method returns this ^ val. Exception:NA Note: This method returns a negative BigInteger if and only if exactly one of this and val are negative.Example 1Test it NowOutput: XOR operation on 5 and 2 gives 7 Example 2Test it NowOutput: XOR operation on 5 and -2 gives -5 Example 3Test it NowOutput: XOR operation on -5 and -2 gives 5 Next TopicJava BigInteger |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India