Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Threads ???

 
Soumy Kumar
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I picked B and C

but answer is C and D

Is it that sleep() needs to be in a try catch block...so its not right to be inserted in line 4 ??
and how about D answer..I don't have idea..

help needed ..

bye
 
trivikram Kumar
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My view is that..when yield is called in the thread..the control is given to the main thread and since there is nothing to be performed in the main thread..the yielded thread will resume as per JVM and then DONE is printed.
The same is interpreted in answer D.
 
Animesh Shrivastava
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my opinion C should be the only answer.
Since resume() is deprecated in 1.4, i dont get convinced by D.
Well, are such questions expected in SCJP for which the answers contain deprecated methods? Please anyone already given SCJP reply to this?


Thanks
 
ramaseshan T
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't see any deprecated methods in the choices and there was no questions on that. But you might get question on what are the deprecated methods in Java 1.4?

-----------------------------
Thanks,
Ramaseshan
SCJP 1.4
 
Jay Pawar
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by ramaseshan T:
But you might get question on what are the deprecated methods in Java 1.4?

I do not think so. SCJP objectives do not mention that.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're not supposed to know the deprecated methods for the exam at all so they won't appear as options in any answer.
 
Mike Gershman
Ranch Hand
Posts: 1272
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't see any deprecated methods in the choices


From j2SE 1.4.2 API doc:
resume()
Deprecated. This method exists solely for use with suspend(), which has been deprecated because it is deadlock-prone.


Many of the SCJP mock exams were written before the suspend/resume methods were deprecated. I don't think you will see any reference to deprecated methods on the real SCJP 1.4 exam because I did not see them in the exam objectives.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic