public static void main( String args[] ) { String n1 = Input.in("Enter a number"); String n2 = Input.in("Enter a second number to perform XOR"); int first = Integer.parseInt(n1); int key = Integer.parseInt(n2); int a = first ^ key; int b = a ^ key; System.out.println(first+" XOR "+key+" == "+a); System.out.println(a+" XOR "+key+" == "+b); System.out.println("|// This simple program demonstrates the power //|"); System.out.println("|// of the logical OR operator (XOR) which //|"); System.out.println("|// deals with data at a binary level. Ex: //|"); System.out.println("|// Num1 XOR key == Num2 //|"); System.out.println("|// Num2 XOR key == Num1 //|"); System.out.println("|// Therefore it is very useful for encryption //|"); Input.waitforexit(); }