• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

thread's

 
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
question 1: Which of the following cannot cause stop executing the thread.
A)Wait B)Synchonized D)setPriority E)sleep.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nitin,
First of all your question is not clear enough for me.
1.wait() method is used to make a thread currently executing a synchronized code go into waiting state.
2.synchronized keyword is used to make a method or block synchronized.
3.setPriority method is used to set the priorty of a thread, and that has to be done before calling start() method of that thread
other wise setPriorty() method has no effect. setPriorty method takes a value between 1 and 10.
4.sleep() method makes the thread executing the code go into waiting state for minimum time given as argument to the sleep() method.
So i presume B and D are answers u r looking for.
I hope this helps you.
regards
ashish
 
Get me the mayor's office! I need to tell him about this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic