I don't know exactly what you mean by "it prints both the threads synchronously".
What
join() does, is make the current thread wait until the thread you call it on stops. So in your code, you first start thread
t1, and then you call
t1.join(); in line 9, which makes the program wait until thread
t1 has finished. Then you start thread
t2 and do the same.
So the threads are not running in parallel, because you make the main thread wait for the first thread to finish before you start the second thread.
If you want both threads to run in parallel and then let the main thread wait for both threads to finish,
you should re-order the statements. First start both threads, and then wait for them to finish: