An operator ^is a bitwise exception or operator .
In this case, it is used as a convenient way to generate a hash code from three integers. (I do not think this is a very good way, but this is another problem ...)
, - GetHashCode(), int, int, .
:
public override int GetHashCode(Box bx)
{
return bx.Height ^ bx.Length ^ bx.Width;
}
SO , XOR : XOR java hashCode(), ?
. , xor - , :
a ^ b ^ a == b
, ints, -, , - - , int.
, ints, :
a ^ a == 0
, ints, , , - .