• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Threads ???

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1272
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic