java吧 关注:1,273,058贴子:12,782,016
  • 0回复贴,共1

求大神指导---帮忙解释下最后三条代码的执行原理过程。,谢谢

只看楼主收藏回复

package demo.d2;
class RelLogOps {
public static void main(String args[]) {
int x, y;
boolean a, b;
x = 10;
y = 11;
if(x < y) System.out.println("x < y");
if(x <= y) System.out.println("x <= y");
if(x != y) System.out.println("x != y");
if(x == y) System.out.println("this won't execute");
if(x >= y) System.out.println("this won't execute");
if(x > y) System.out.println("this won't execute");
a = true;
b = false;
if(a && b) System.out.println("this won't execute");
if(!(a && b)) System.out.println("!(a && b) is true");//请帮我解释下最后三条if代码的执行原理
if(a || b) System.out.println("a || b is true");
if(a ^ b) System.out.println("a ^ b is true");
}
}


1楼2016-05-21 20:49回复