The join() method of the Thread class enables one thread to wait until another thread has finished running. If t is a Thread object that is presently running, t.join() will ensure that t is ended before the program executes the next instruction. Until the thread on which it is called is dead, the current thread will be placed on hold by the join() function https://firstcode.school/joining-threads-in-java/