hi,
I am confused with the below code which is from khalid Mughal's book
Output on my machine: 23 24 21 13 14 11 22 12
Main
Thread prints 23 at line 1
Thread-0 is started.
Main Thread prints 24 at line 2
Thread-0 prints 21 at line 3
t1.join at line 4 makes Thread-0 to join after the Main thread is complete.
So Main thread continues and returns t2.
Again 13 is printed at line 1
Thread-1 is started
14 is printed at line 2
11 is printed at line 3
I don't understand how 22 is printed. Can anyone explain it?
Thanks
Sravani