多选题 Given x is declared with a valid integer, which conditional statement will not compile?
  • A. if(x == 0) {System.out.println("True Statement");}
  • B. if(x == 0) {System.out.println("False Statement");}
  • C. if(x == 0) {;} elseif(x == 1){System.out.println("Valid Statement");}
  • D. if(x == 0); else if(x == 1){} else {;}
【正确答案】 C
【答案解析】该语句将无法编译。在else和if关键字之间没有空格,编译器将抛出类似于“Error: method elseif(boolean)not found...”的错误。A、B和D不正确。所有的这些条件语句都会编译成功。