I'm having trouble knowing the difference between the join () method and the synchronized switch.
I'm having trouble knowing the difference between the join () method and the synchronized switch.
join()
stops execution of the current thread until the thread that invoked the join()
method is completely executed.
synchronized
prevents multiple threads from executing a block of code or accessing a variable at the same time.