class Exer03 { public static void main(String[] args) { //1)对下列代码,若有输出,指出输出结果。 int x = 4; int y = 1; if (x > 2) { if (y > 2) // 省略{} 只有一条语句 System.out.println(x + y); // 不是语句体 System.out.println("lovecoding"); } else System.out.println("x is " + x); boolean b = true; //如果写成if(b=false)能编译通过吗?如果能,结果是? if(!b) //建议:if(!b) System.out.println("a"); else if(b) System.out.println("b"); else if(!b) System.out.println("c"); else System.out.println("d"); } }