t1.join();
t3.join();
t2.join();
So in this senerio t2 will run first then t3 then only t1 because K&B say"When one thread calls the join() method of another thread, the currently running thread will wait until the thread it joins with has completed"
How did you draw this conclusion?
First, you need to realize that there are 4 threads in this scenario. The first three are the threads that were started, and the fourth is the thread that started the other three. (let's call this the main thread, assuming that this code is in the main method)
So the "t1.join()" command basically tells the main thread to wait until t1 finishes. Once that is done, then it can go on to wait for t3 to finish, and then for t2 to finish.
Also note, that when the main thread waits for t1, t2, or t3 to finish, it may already have been completed, in which case, it will retrun immediately.
You can't draw any conclusion from the code, which thread run first, nor which thread finished first. You only know that the main thread waited for the t1 thread first, t3 thread second, and t2 thread last -- and those threads may not have finished in that order.
Henry