网友您好, 请在下方输入框内输入要搜索的题目:
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();
参考答案