• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jcert sleep question

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From JavaCertificate:


- Which of the following statements are true? [Check all correct answers]
1. The notify() method wakes up a single thread that is waiting on this object's monitor.
2. The yield method allows other threads of the same priority to execute.
3. The Thread class has a static method called yield.
4. The wait() method causes the current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object.
5. The sleep() method of the Thread class with one argument takes an input-parameter of type int.


Answers are 1, 2, 3, 4 and I agree with those. But it seems to me that with the way it is worded, 5 is also correct. The declaration for the one argument sleep() method has an input-parameter of type long but at run time it will take an int. The int is valid and will be promoted to long.
In this case the word that troubles me is "takes". This does not seem to me to be limited to compilation time. If the question has used the word "declares" instead, I would have known what the author was intending to ask.
On so many of the questions in all the mock exams, it is important to read the wording of the question carefully to be able to answer it correctly. Perhaps this has caused me examine the wording too closely. Sometimes I feel I have to second guess what the intent of the question is. And sometimes I seem to be over-thinking the question.
My questions are:
- Does anybody read 5 the way I do or am I way off on this one?
- On the exam, how should we deal with questions that aren't quite exacting enough. Hopefully most of those questions have been cleaned up in this version of the exam.
 
Ranch Hand
Posts: 330
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi don.

But it seems to me that with the way it is worded, 5 is also correct


sleep() method takes a long argument.
 
Don Wood
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Dennis,
I guess you're telling me that I am reading too much into this one.
But I do hope the questions on the exam are worded more precisely.
 
Arch enemy? I mean, I don't like you, but I don't think you qualify as "arch enemy". Here, try this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic