网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
classWorkimplementsRunnable{Threadother;Work(Threadother){this.other=other;}publicvoidrun(){try{other.join();}catch(Exceptione){}System.out.print("afterjoin");}}classLaunch{publicstaticvoidmain(String[]args){newThread(newWork(Thread.currentThread())).start();System.out.print("afterstart");}}结果为:()
A.afterjoin
B.afterstart
C.afterjoinafterstart
D.afterstartafterjoin
参考答案
更多 “ classWorkimplementsRunnable{Threadother;Work(Threadother){this.other=other;}publicvoidrun(){try{other.join();}catch(Exceptione){}System.out.print(afterjoin);}}classLaunch{publicstaticvoidmain(String[]args){newThread(newWork(Thread.currentThread())).start();System.out.print(afterstart);}}结果为:()A.afterjoinB.afterstartC.afterjoinafterstartD.afterstartafterjoin ” 相关考题
考题
WhichtwocodefragmentswillexecutethemethoddoStuff()inaseparatethread?()
A.newThread(){publicvoidrun(){doStuff();}}B.newThread(){publicvoidstart(){doStuff();}}C.newThread(){publicvoidstart(){doStuff();}}.run();D.newThread(){publicvoidrun(){doStuff();}}.start();E.newThread(newRunnable(){publicvoidrun(){doStuff();}}).run();F.newThread(newRunnable(){publicvoidrun(){doStuff();}}).start();
考题
GiventhatastaticmethoddoIt()inaclassWorkrepresentsworktobedone,whatblockofcodewillsucceedinstartinganewthreadthatwilldothework?CODEBLOCKa:Runnabler=newRunnable(){publicvoidrun(){Work.doIt();}};Threadt=newThread(r);t.start();CODEBLOCKb:Threadt=newThread(){publicvoidstart(){Work.doIt();}};t.start();CODEBLOCKc:Runnabler=newRunnable(){publicvoidrun(){Work.doIt();}};r.start();CODEBLOCKd:Threadt=newThread(newWork());t.start();CODEBLOCKe:Runnablet=newRunnable(){publicvoidrun(){Work.doIt();}};t.run();
考题
针对下列程序段,需要( )个测试用例才可以满足语句覆盖的要求。
switch(value){case 0:other=30;break;case 1:other=50;break;case 2:other=300;case 3:other=other/value;break;default:other=other*value;}A.2
B.3
C.4
D.5
考题
1、针对下列程序段,需要()个测试用例才可以满足语句覆盖的要求。 switch (value ) { case 0: other = 30; break; case 1: other = 50; break; case 2: other = 300; case 3: other = other/value; break; default: other = other * value; }A.2B.3C.4D.5
考题
2、若有以下说明和语句,则引用方式不正确的是? struct worker{ int no; char *name; }work, *p=work;A.work.noB.(*p).noC.p->noD.work->no
考题
若有以下说明和语句,则引用方式不正确的是? struct worker{ int no; char *name; }work, *p=work;A.work.noB.(*p).noC.p->noD.work->no
热门标签
最新试卷