0

I am looking for some better explanation on java thread join() method and it's behavior. Javatpoint alrady given this definition, "The join() method waits for a thread to die. In other words, it causes the currently running threads to stop executing until the thread it joins with completes its task". Someone please explain this definition,I am looking for answer in simple and practical way and I can not get better vision on how join() really works when program have multiple threads

  • Java API says that join() "waits for this thread to die". So memorize it as "the thread joins all the other dead threads in heaven" – Alexander Kulyakhtin Apr 29 '18 at 17:28
  • @Pasindu Senarathne, go through this example: https://www.journaldev.com/1024/java-thread-join-example Try to implement and understand the flow. Hope this helps :) – Dipan Apr 29 '18 at 18:11

0 Answers0