首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
阅读下列代码段 class TestimplementsRunnable{ publicintrun(){ inti=0; while(true){ i++; System.out.println("i="+1);
阅读下列代码段 class TestimplementsRunnable{ publicintrun(){ inti=0; while(true){ i++; System.out.println("i="+1);
admin
2010-03-15
15
问题
阅读下列代码段 class TestimplementsRunnable{ publicintrun(){ inti=0; while(true){ i++; System.out.println("i="+1); } } } 上述代码的编译结果是( )。
选项
A、程序通过编译并且run()方法可以正常输出递增的i值
B、程序通过编译,调用run()方法将不显示任何输出
C、程序不能通过编译,因为while的循环控制条件不能为“true”
D、程序不能通过编译,因为run()方法的返向值类型不是void
答案
D
解析
while的循环控制条件可以为“true”,run方法没有返回值,所以不能是int型,故此程序不能通过编译。
转载请注明原文地址:https://kaotiyun.com/show/Un9p777K
本试题收录于:
二级Java题库NCRE全国计算机二级分类
0
二级Java
NCRE全国计算机二级
相关试题推荐
在数据库设计中,将E-R图转换成关系数据模型的过程属于______。
下列叙述中,不属于结构化分析方法的是______。
希尔排序法属于哪—种类型的排序法______。
公司中有多个部门和多名职员,每个职员只能属于一个部门,一个部门可以有多名职员,从职员到部门的联系类型是()。
用树形结构表示实体类型及实体间联系的数据模型称为()。
对象实现了数据和操作的结合,是指对数据和数据的操作进行()。
在结构化设计方法中,生成的结构图(S.C)中,带有箭头的连线表示()。
数据库系统中实现各种数据管理功能的核心软件称为_________。
根据域名代码规定,表示政府部门网站的域名代码是
AWT中用来表示颜色的类是()。
随机试题
汉字的特点。
已知随机变量X的分布函数为F(x),若y=g(x)是单调递减函数,则随机变量Y=g(X)的分布函数G(y)=________.
在胸骨左缘第2~4肋间可听到Ⅱ~Ⅳ级喷射性收缩期杂音的先天性心脏病是
A.泻下利水、消肿散结B.泻下逐饮、消肿散结C.泻下去积、消肿散结D.泻下通便、消肿散结E.泻下除胀、消肿散结商陆的功效是
当事人签订买卖房屋或者其他不动产物权的协议,为保障将来实现物权,按照约定可以向登记机构申请预告登记。下列情形中,预告登记失效的有()。
如信用条件为“2/10,n/30”,放弃现金折扣的成本为()。
庐陵孝献王义真,美仪貌,神情秀彻。初封桂阳县公,食邑千户。年十二,从北征大军进长安,留守柏谷坞,除员外散骑常侍,不拜。及关中平定,高祖议欲东还,而诸将行役既久,咸有归愿,止留偏将,不足镇固人心,乃以义真行都督雍、凉、秦三州司州之河东、平阳、河北三郡诸军事、
如果不堆叠,直径16厘米的盘子里面最多可以放多少个边长6公分的正方体?( )
企业使命是()。
已知当χ→0时,-1与cos-1是等价无穷小,则常数a=_______.
最新回复
(
0
)