单选题
Java
2016-02-26
下面程序段的输出结果为( )。
A.a=true b =false
b =true c =true
b =true c =true
B.a=true b =false
b =true c =false
b =true c =false
C.a=true b =true
b =true c =false
b =true c =false
D.a=false b =false
b =true c =false
b =true c =false
参考答案
C
答案解析
本题考查关系运算符<和==。题目中a=(3<5);比较3和5的大小,因为3<5,返回true 给a;b=(a==true);判断a 是否为真,因为a 确实为真,返回true给b ;c =(b ==false);判断b 是否为假,因为b 不为假,返回false 给c。最后结果a=true ,b =true ,b =true ,c =false ,选项C正确。