in Education by
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 Select the correct answer from above options JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
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.

Related questions

0 votes
0 votes
    Which of these method wakes up all the threads? (a) wakeAll() (b) notify() (c) start() (d ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
0 votes
    Which key helps to step out of the caller of currently executed method? (a) F3 (b) F5 (c) F7 ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which is the method invoked to connect the last vertex back to the first? (a) closePath() (b) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 22, 2021 in Education by JackTerrance
0 votes
    Which of these method is used to explicitly set the priority of a thread? (a) set() (b) make() ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which of these method is used to begin the execution of a thread? (a) run() (b) start() (c ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which of these method is used to tell the calling thread to give up a monitor and go to sleep ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    How can we make methods available on all objects? (a) Object.add(methods) (b) Object.methods(add) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    Which of these clause will be executed even if no exceptions are found? (a) throws (b) finally (c ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 25, 2021 in Education by JackTerrance
...