A.Java可在Solaris平臺(tái)上運(yùn)行 B.Java可在Windows平臺(tái)上運(yùn)行 C.Java語(yǔ)言與平臺(tái)無(wú)關(guān)。Java程序的運(yùn)行結(jié)果與操作系統(tǒng)無(wú)關(guān) D.Java語(yǔ)言與平臺(tái)無(wú)關(guān)。Java程序的運(yùn)行結(jié)果依賴于操作系統(tǒng)
1. class MyThread implements Runnable { 2. public void run() { 3. System.out.print("go "); 4. } 5. 6. public static void main(String [] args) { 7. // insert code here 8. t.start(); 9. } 10. } 和如下四句: Thread t = new MyThread(); MyThread t = new MyThread(); Thread t = new Thread(new Thread()); Thread t = new Thread(new MyThread()); 分別插入到第5行,有幾個(gè)可以通過(guò)編譯?()
A.0 B.1 C.2 D.3
class Thread2 implements Runnable { void run() { System.out.print("go "); } public static void main(String [] args) { Thread2 t2 = new Thread2(); Thread t = new Thread(t2); t.start(); } } 結(jié)果為()
A.go B.編譯失敗 C.代碼運(yùn)行,無(wú)輸出結(jié)果 D.運(yùn)行時(shí)異常被拋出