Originally Posted by
huma
My analysis is straight forward it should print
start1 endmain end1 start2 end2
In what case can Thread.sleep() can through exception?
Why don't you just run the code? Its small.
Its not clear how deterministic the code is, in general threaded code runs and does its thing, and you don't know what order will be used unless you use java.util.concurrent.Semaphore or similar constructs.