首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列程序创建了一个线程并运行,横线处应填入的正确代码是( )。 public class Try extends Thread{ public static void mai n(Stri ng args[]){ Thread t =ne w Try()
下列程序创建了一个线程并运行,横线处应填入的正确代码是( )。 public class Try extends Thread{ public static void mai n(Stri ng args[]){ Thread t =ne w Try()
admin
2012-12-02
52
问题
下列程序创建了一个线程并运行,横线处应填入的正确代码是( )。
public class Try extends Thread{
public static void mai n(Stri ng args[]){
Thread t =ne w Try();
___________;
}
public void run(){
Syste m.out .pri ntln("Try !");
}
}
选项
A、t .start
B、t .class
C、t .thread
D、t .static
答案
A
解析
start()是类Thread 的方法,其中start()方法用于启动线程,使之从新建状态转入就绪状态并进入就绪队列排队,一旦轮到它来享用CPU 资源时,就可以脱离创建它的主线程独立地开始自己的生命周期了。
转载请注明原文地址:https://kaotiyun.com/show/y9ID777K
本试题收录于:
二级Java题库NCRE全国计算机二级分类
0
二级Java
NCRE全国计算机二级
相关试题推荐
小王从农贸市场买来一条金鱼,没过几天鱼就死了。下列最有可能导致金鱼死亡的原因是()。
在月球上可能发生的现象是()。
下列战役按时间先后顺序排列正确的是()。①武汉会战②淞沪会战③徐州会战④太原会战⑤枣庄会战
将水生植物和小鱼放入盛有水的玻璃缸中,密闭后置于光照、温度等适宜条件下。下列相关叙述,错误的是()。
一批物资分别由16列火车从甲站紧急运送到600千米外的乙站,现已知每列火车在运行途中间隔不得低于40千米,且火车运行速度为200千米/小时,那么将这批物资完全运到乙站至少需要多少小时?
编号从1到10的10个白球排成一行,现按照如下方法涂红色:①涂2个球:②被涂色的2个球的编号之差大于2。那么不同的涂色方法有多少种?
某人对某办公软件解密,并制成光盘销售。他应承担的法律责任是()。
我国《行政处罚法》规定,行政机关在调查或进行检查时,执法人员不得少于两人,并应当向当事人或有关人员出示证件。这体现了行政处罚程序中的()。
下列关于生命科学研究方法与发展过程的叙述,正确的是()。
在教学中教师通过指导学生运用一定的仪器设备进行独立实验作业而获得知识和技能的方法是()
随机试题
下列关于单机试运行和联动试运行的说法,不正确的是()。
一般垄断资本主义阶段资本国际化的主要形式是【】
Seanalivedintheinpatienthospiceunitformorethanamonth,farlongerthananyonewouldhavepredicted,sustainedonlyon
擅自添加着色剂、防腐剂等辅料的必须是列入国家药品标准的品种
A.麦角菌科B.多孔菌科C.马尾藻科D.松萝科E.棕榈科冬虫夏草来源于()
国内某作家的一篇小说在一家日报上连载两个月,第一个月月末报社支付稿酬2000元;第二个月月末报社支付稿酬5000元。该作家两个月所获稿酬应缴纳的个人所得税为()元。
求幂级数的收敛域,并求其和函数.
下列关于OSPF协议的描述中,错误的是()。
为了使标签Labell透明且不具有边框,以下正确的属性设置是
Asresearcherslearnmoreabouthowchildren’sintelligencedevelops,theyareincreasinglysurprisedbythepowerofparents.T
最新回复
(
0
)