File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Threads - suspend() and resume() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Threads - suspend() and resume()" Watch "Threads - suspend() and resume()" New topic

Threads - suspend() and resume()

eskay kumar
Ranch Hand

Joined: Jul 22, 2000
Posts: 71
This qn is from Jxam.

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.
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
thanks a ton !
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13035
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
return ;
When the Thread is supended, the object is locked up as far as access by another Thread trying to call synchronized methods.

eskay kumar
Ranch Hand

Joined: Jul 22, 2000
Posts: 71
thanks Bill for replying !
I agree. Here's the link:
subject: Threads - suspend() and resume()
It's not a secret anymore!