I am confused from this output ... If we invoked start() again on the same Thread obj... it will throw IllegalThreadStateException.. but how come after the exception is thrown it is printing the "go"... the program should get terminated.
So if the firstly started thread gets the chance to run it should print "go " and then the exception or only the exception... how come it is printing a message from run() after an exception is thrown..???
please send some explanation..Thanks
The main thread catching the exception does indeed terminate the program. However, all that logic is happening in the main thread. Until the program actually terminates, the other thread is still active and running. This is one possible sequence of events: