Java code for XOR

Hacker Rank Puzzle