Given:
public class Main extends Thread { public static void main(String[] args) { try {//from www.j av a 2 s. c o m Thread t = new Thread(new Main()); Thread t2 = new Thread(new Main()); } catch (Exception e) { System.out.print("e "); } } public void run() { for (int i = 0; i < 2; i++) { try { Thread.sleep(500); } catch (Exception e) { System.out.print("e2 "); } System.out.print(Thread.currentThread().getName() + " "); } } }
Which are true? (Choose all that apply.)
B is correct.
In main()
, the start()
method was never called to start "t" and "t2", so run()
never ran.
If start()
was invoked for "t" and "t2", then D and E would have been correct.