Given:
3. public class Main extends Thread { 4. public static void main(String[] args) { 5. Thread t1 = new Thread(new Main()); 6. t1.start(); //from w ww.j av a2s . c o m 7. t1.join(); 8. for(int i = 0; i < 1000; i++) // Loop #1 9. System.out.print(Thread.currentThread().getName() + " "); 10. } 11. public void run() { 12. for(int i = 0; i < 1000; i++) // Loop #2 13. System.out.print(Thread.currentThread().getName() + " "); 14. } }
Which are true? (Choose all that apply.)
A is correct.
The join()
method throws an exception, so it must be handled or declared; if it was, then D would be correct.