题目内容
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();
查看答案
搜索结果不匹配?点我反馈