• 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

sleep()

 
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This question bothers me:
True or False:
There is a method that you can call on an instance of the Thread class that puts the instance to sleep for a specified number of milliseconds.
Answer: False
"The sleep() method is static; it always put to sleep the currently executing thread"
Does this seem like a legitimate test question?
I guess the keyword in the question was "instance" but it seems a little sketchy to me.
Any thoughts?
Regards,
Drew
 
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I think the key part of the question may be
-- call on an instance of the Thread class .....
if it had said call FROM an instance then it would be true.
Hope that helps,
Terry
 
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I think you can call Thread.sleep() within an instance of Thread class.
 
reply
    Bookmark Topic Watch Topic
  • New Topic