单选题 下列程序的运行结果是______。
public class Test{
public static void main(String[] args){
int x=3,y=4,z=5;
if(x>3){
if(y<2)
System.out.println("show one");
else
System.out.println("show two");
}
else{
if(z>4)
System.out.println("show three");
else
System.out.println("show four");
}
}
}
  • A.show one
  • B.show two
  • C.show three
  • D.show four
【正确答案】 C
【答案解析】[解析] 该程序主要是考查if语句的用法。由于x=3,所以第一个if里面的表达式的值为false,进入下面对应的else的运算中。又由于z=5,使得里面的z>4的值为true,所以程序运行的最后结果为show three。