This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
options are : 1)1 2 3 4 2)1 2 3 3)1 2 4)Nothing. This is not a valid way to create and start a thread. 5)1 Assuming deprecated methods will be considered 'ok' in the exam which is the correct ans. ans given is 3) with the explaination : "the code will run, but the thread suspends itself after displaying "2". Threads cannot un-suspend themselves (since they ARE suspended and therefore not running!)." But i thought using resume() - would resume the thread, and the thread will execute again. Can soemone please expalin then what is the significance of resume - once a thread has been suspended, and how would one use it. I have another favor to ask - i have a copy of RHE but the CD that came along with it is corrupted. I can't open the tester.jar file. Can someone please mail that to me at shilpakumar@hotmail.com thanks a ton ! shilpa
resume would resume the Thread BUT WHO WOULD CALL resume? The only user Thread in the entire application is suspended indefinately! Sheeesh! suspend and resume were used to enable multiple Threads to cooperate but are now deprecated because they did not work well with synchronized blocks. public synchronized void doSomething(){ // stuff suspend(); return ; } When the Thread is supended, the object is locked up as far as access by another Thread trying to call synchronized methods. Bill