首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下面程序段的输出结果为( )。 public class Test { public static void mai n(Stri ng args[]) { booleana,b ,c ; a=(3<5); b =(a==true); Syste m.o
下面程序段的输出结果为( )。 public class Test { public static void mai n(Stri ng args[]) { booleana,b ,c ; a=(3<5); b =(a==true); Syste m.o
admin
2012-12-02
66
问题
下面程序段的输出结果为( )。
public class Test
{
public static void mai n(Stri ng args[])
{
booleana,b ,c ;
a=(3<5);
b =(a==true);
Syste m.out .pri ntln("a="+a+"b ="+b);
c =(b ==false);
Syste m.out .pri ntln("b ="+b +"c ="+c);
}
}
选项
A、a=true b =falseb =true c =true
B、a=true b =falseb =true c =false
C、a=true b =trueb =true c =false
D、a=false b =falseb =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正确。
转载请注明原文地址:https://jikaoti.com/ti/6XkiFFFM
本试题收录于:
二级Java题库NCRE全国计算机二级分类
0
二级Java
NCRE全国计算机二级
相关试题推荐
阅读文字资料,回答下列问题:2006年是“十一五”的开局之年。江苏省各级卫生部门在省委、省政府的领导下,紧紧围绕富民强省、“两个率先”目标,全面落实科学发展观,重点加强基层、基础工作。大力发展农村卫生、公共卫生、社区卫生。全面推进中医药、卫生监督
下列关于我国上下级国家机关之间关系的说法正确的是()。
某制币厂为纪念奥运会特制纪念金币若干枚,每枚售价20088.8元。其广告宣传主要内容为:(1)纪念币系纯金制造;(2)纪念币数量仅有2008枚。后经证实,该纪念币系金铜合金;纪念币数量为20000枚。为此,购买者与该
剧烈运动后,人们常常满脸通红,大汗淋漓,这主要是因为皮肤的什么功能?()
将下面《水浒传》的故事按事件的发展顺序排列,正确的是()。①景阳冈打虎②独臂擒方腊③浔阳楼题反诗④宿太尉招安
下面关于气候变化与绿色碳汇说法不正确的是()。
下列有关需求的表述,不正确的是()。
根据以下资料,回答以下问题。中国汽车工业协会发布的2009年4月份中国汽车产销数据显示,在其他闰家汽车销售进一步疲软的情况下,国内乘用车销量却持续上升,当月销量已达83.1万辆,比3月份增长7.59%,同比增长37.37%。乘用车细分为
传统家训家规是我国古代以家庭为范围的道德教育形式,也是中华道德文化传承的一种方式。我国历史上流传下来的家训家规,始作者多是文化名人或著名官宦,社会影响较为广泛。这些家训家规的功能远远超出对本家族的教育作用,而成为社会教育的一种独特形式,为社会提供了家庭教育
下列能够正确创建线程的方法是()。①继承java.lang.Thread类,并重写run()方法②继承java.lang.Runnable类,并重写start()方法③实现java.lang.Thread接口,并实现run()方法④实现java
随机试题
某公司库存原材料一批,成本20万元,期末市价22万元,期末在资产负债表中按20万元列示该项资产的价值,这种做法采用的计量属性是()
垂直距离是指
中国工程咨询协会会员中,个人会员的权利有()
下列关于资产评估价值类型的有关说法不正确的有()。
下列哪一项不属于价值型股票基金的范围?()
老师带领学生学习了《雪绒花》一课,课程临近结束时,老师请同学们发挥想象力,根据歌曲内容以及创作背景,编排一个音乐剧,同学们都积极参与其中。请问编排音乐剧这个环节属于哪一种活动?()
()也称为组装测试。
用二维表的形式来表示实体之间联系的数据模型叫做______。
DaylightSavingTimebeginsonMonday,April3,2005.PeopleinmostpartsoftheUnitedStateswillturntheirclocksaheadone
HemingwayAmericanwriter,HemingwaywasborninOakPark,Illinois.Hestartedhiscareerasawriterinanewspaperoffic
最新回复
(
0
)