class ThreadBoth extends Thread implements Runnable {
public void run(){ System.out.print("hi "); }
public static void main(String [] args){
Thread t1 = new ThreadBoth();
Thread t2 = new Thread(t1);
t1.run();
t2.run();
}
}
結(jié)果為:()
A.hi
B.hi hi
C.編譯失敗
D.代碼運行,但無輸出結(jié)果