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

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


相关考题:

在Windows中,下列正确的文件名是A.work:2B.work*2C.work[2]D.work2

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();

在HTML文件中,( )标记在页面中显示work为斜体字。A.<pre>work</pre>B.<u>work</u>C.<i>work</i>D.<b>work</b>

针对下列程序段,需要( )个测试用例才可以满足语句覆盖的要求。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

下列哪些工程名是合法的()。A.work_2B.work2C.2workD.work2_

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