What does a bitwise exclusive OR do in Java?

后端 未结 4 899
天涯浪人
天涯浪人 2020-12-20 19:18

Given:

public class Spock {
    public static void main(String[] args) {
        Long tail = 2000L;
        Long distance = 1999L;
        Long story = 1000L         


        
4条回答
  •  旧巷少年郎
    2020-12-20 19:49

    From http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.22.2

    For ^, the result value is true if the operand values are different; otherwise, the result is false.

提交回复
热议问题