Home / CSE MCQs / JAVA MCQs :: Discussion

Discussion :: JAVA MCQs

  1. Which of these method can be used to make the main thread to be executed last among all the threads?
  2. A.
    stop()
    B.
    sleep()
    C.
    join()
    D.
    call()

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    By calling sleep() within main(), with long enough delay to ensure that all child threads terminate prior to the main thread.


Be The First To Comment