What is the difference between the join () method and the synchronized statement? [closed]

-2

I'm having trouble knowing the difference between the join () method and the synchronized switch.

    
asked by anonymous 12.11.2018 / 02:46

1 answer

2

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.

    
12.11.2018 / 12:15