[單項(xiàng)選擇題] 下列程序通過實(shí)現(xiàn)Runnable接口創(chuàng)建一個(gè)線程,選擇正確的語句填入程序的橫線處。class MyRun implements Runnable
2021-07-20
[單項(xiàng)選擇題] 下列程序通過實(shí)現(xiàn)Runnable接口創(chuàng)建一個(gè)線程,選擇正確的語句填入程序的橫線處。
class MyRun implements Runnable
String str;MyRun(String s)
str = s;
public void run()
System.out.println(str);
public class ex40 public static void main(String[] args)
String name = "實(shí)現(xiàn)階段Runnable 接口";
MyRun my = new MyRun(name);
Thread th =
th. start ( );
A. new MyRun(my)
B. new Thread()
C. new Thread(my)
D. Thread(my)
正確答案:C
詞條內(nèi)容僅供參考,如果您需要解決具體問題
(尤其在法律、醫(yī)學(xué)等領(lǐng)域),建議您咨詢相關(guān)領(lǐng)域?qū)I(yè)人士。