fork download
  1. class Idiom237XorIntegers {
  2. public static void main (String[] args) {
  3. int a = 230;
  4. int b = 42;
  5. int c = a ^ b;
  6.  
  7. System.out.println(String.format("a is %8s", Integer.toBinaryString(a)));
  8. System.out.println(String.format("b is %8s", Integer.toBinaryString(b)));
  9. System.out.println(String.format("c is %8s", Integer.toBinaryString(c)));
  10. System.out.println(String.format("c == %s", c));
  11. }
  12. }
Success #stdin #stdout 0.1s 48364KB
stdin
Standard input is empty
stdout
a is 11100110
b is   101010
c is 11001100
c == 204