1.

Which of this method can be used to make the main thread to be executed last among all the threads?(a) stop()(b) sleep()(c) join()(d) call()This question was posed to me in exam.My query is from isAlive(), Join() & Thread Synchronization topic in portion Multithreading of Java

Answer»

Correct choice is (b) sleep()

Explanation: By calling sleep() within main(), with long enough DELAY to ENSURE that all CHILD threads TERMINATE prior to the main thread.



Discussion

No Comment Found

Related InterviewSolutions