Originally posted by dennis zined:
Hi Vad. You're the man! Thanks a bunch.
Is the correct answer to your practice question : B, F, G?
thanks.
Should be B, F, H. G is incorrect because, thanks to the runtime exceptions, the current thread looses its lock letting another thread give it a try (well, not a really successful try
). So, all of the created threads will eventually run. H is correct because throwing a runtime exception allows for the program to finish. If you had sb.wait() instead, both threads would enter run() and get blocked there on waiting forever. There is no code provided to notify them.