单项选择题
A. Thread.sleep(1);
B. Thread.sleep(100);
C. Thread.sleep(1000);
D. try{ Thread.sleep(1); ) catch (Exception e) { }
E. try{Thread.sleep(100); ) catch (Exception e) { }
F. try{Thread.sleep(1000); ) catch (Exception e) { }
单项选择题 现有: class ThreadExcept implements Runnable { public void run() { throw new RuntimeException("exception "); } public static void main(Stri_ng [] args) { new Thread (new ThreadExcept()).start(); try { int x=Integer.parselnt (args [0]); Thread. sleep (x); System.out.print("main"); } catch (Exception e) { } } } 和命令行: java ThreadExcept l000 哪一个是结果?()
单项选择题 现有:t是一个合法的Thread对象的引用,并且t的合法run()方法如下: public void run() { System.out.print ("go"); } 及: t.start(); t.start(); t.run(); 哪一个是结果?()
单项选择题 现有: class ThreadBoth extends Threaa implements Runnable { public void run() (System.out.print("hi"); } public static voicl main (String [] args) { Thread tl=new ThreadBoth(): Thread t2 = new Thread (tl): tl.run(): t2.run(): } 结果为:()