多项选择题
A. for (int i=0; i< a.size(); i++) System.out.println(a.get(i)));
B. for (int i=0; i< a.size(); i++) System.out.println(a[i]);
C. while( iter.hasNext() ) System.out.println(iter.next()) ;
D. for (int i=0, i< a.size(); i++) System.out.println(iter[i]);
E. for (int i=0; i< a.size(); i++) System.out.println(iter.get(i));
单项选择题 Whatcancauseathreadtobecomenon-runnable?()
单项选择题 public class A extends Thread { A() { setDaemon(true); } public void run() { (new B()).start(); try { Thread.sleep(60000); } catch (InterruptedException x) {} System.out.println(“A done”); } class B extends Thread { public void run() { try { Thread.sleep(60000); } catch (InterruptedException x) {} System.out.println(“B done”); } } public static void main(String[] args) { (new A()).start(); } } What is the result?()
单项选择题 public class X implements Runnable { private int x; private int y; public static void main(String [] args) { X that = new X(); (new Thread( that )).start(); (new Thread( that )).start(); } public void run() { for (;;) { synchronized (this) { x++; y++; } System.out.println(Thread.currentThread().getName() + “x = “ + x + “, y = “ + y); } } } What is the result?()