class BitwiseXor {
void Display (byte A, byte B) {
System.out.println ( "byte: "
+ (int)A + " ^ " + (int)B
+ " = " + (A ^ B));
System.out.println ( "short: "
+ (int)A + " ^ " + (int)B + " = "
+ ((short)A ^ (short)B));
System.out.println ( "int: "
+ (int)A + " ^ " + (int)B + " = "
+ ((int)A ^ (int)B));
System.out.println ( "long: "
+ (long)A + " ^ " + (long)B + " = "
+ ((long)A ^ (long)B));
}
static void main (String[] Args) {
BitwiseXor App;
App = new BitwiseXor();
App.Display ((byte)7, (byte)-2);
App.Display ((byte)-7, (byte)-2);
}
}