定义三个布尔变量: boolean a = true, b = false, c = false;
如果 && 优先级高
a || b && c = a || false && false = a || false = true || false = true
如果 || 优先级高
a || b && c = true || false && c = true && c = true && false = false.
Talk is cheap.

public static void main(String[] args) {
        boolean a = true, b = false, c = false;

        System.out.println(a || b && c); // true
        System.out.println( (a || b) && c); // false
    }

NewBie
10 声望0 粉丝