here both (x>y) and (num1 != num2) are boolean conditions ,both will evaluate and return a boolean value.
^ operator is
Boolean XOR opeartor ,it worka as follows
If x is true and y is false, the result is true.
If x is false and y is true, the result is true.
Otherwise, the result is false.
Both x and y are evaluated before the test.
System.out.println((x > y) ^ (num1 != num2));
so above expression will true since (x>y) =false and (num1!=num2) =true
according to send rule
for more information visit this site:
http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part1/Java/Chapter02/operators.html
hope this helps.