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 Thread doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Thread doubt" Watch "Thread doubt" New topic

Thread doubt

Swapna James
Ranch Hand

Joined: Jul 26, 2005
Posts: 56

I came across this question while doing a mock exam

The result is "In run" will be printed out and the execution will stop. Can anybody explain what happens here?


SCJP 1.4
Stephen O'Kane

Joined: Aug 17, 2005
Posts: 26
Hi Swapna,

I don't think i'd bother trying to answer this question, as the suspend() method has been deprecated for quite a long time now, and the question obviously then comes from a very old exam. See

Java API deprecated Thread methods

for an explanation of this.

Swapna James
Ranch Hand

Joined: Jul 26, 2005
Posts: 56
Hi Sok,

I know about the depreciated methods in Thread. But are you sure that this type of question will not come for SCJP1.4?

Anyway I would like to know what happens in that code.

I agree. Here's the link:
subject: Thread doubt
It's not a secret anymore!