java - threads running in sequence -


I'm new to Java and I'm wondering how to do something in an interview question.

You have three threads T1 , T2 and T3 . How do you ensure that the order T1 , T2 , T3 .
The interviewer asked me to write this program.
I know that the answer to this question is join or the bottom link but how could I not be able to succeed, can you tell me to do this How about to know?

Create 3 threads but do not start them, go as follows

  T1.start (); T1.join (); T2.start (); T2.join (); T3.start ();   

Thread waits for a thread to finish adding, so the guarantee of the command is

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -