A.Line 35 will not compile. B.Line 36 will not compile. C.Line 37 will not compile. D.Line 38 will not compile.
現(xiàn)有: class ThreadExcept implements Runnable { public void run() { throw new RuntimeException("exception "); } public static void main(String [] args) { new Thread(new ThreadExcept()).start(); try { int x = Integer.parseInt(args[0]); Thread.sleep(x); System.out.print("main "); } catch (Exception e) { } } } 和命令行: java ThreadExcept 1000 哪一個是結(jié)果?()
A. main B. 編譯失敗 C. 代碼運行,但沒有輸出 D. main java.lang.RuntimeException: exception
程序員想要創(chuàng)建一個名為MyThread的類以便在main方法中用Thread實例化。 對于下面三行: MyThread必須繼承Thread。 MyThread必須實現(xiàn)Thread。 MyThread必須覆蓋public void run()。 有幾行是正確的?()
A. 0 B. 1 C. 2 D. 3