... XOR in Java? Yes, Java does have an XOR (Exclusive Or) operator – it is represented by the caret character – the “^”.
www.programmerinterview.com