• 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

please eplain this thread question

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1] Are the following statements true?


1)A timeout argument can be passed to join methods
2)join methods needs the InterruptedException in its throws clause like sleep and wait?
3)If execution of the synchronised block completes abruptly, then the lock is released
4)The Thread.sleep method causes the thread to move to the Not-Runnable state
5)Some implementations of the Thread.yield method will not yield to a thread of lower priority


2]if the thread calling wait() method doesnt own the lock then illegalMonitorStateEception is thrown which is unchecked

so does it mean it is runtime eception so can we conclude that
wait() throws runtime exception

3)what is non runnable state? with respect to following question
Which of the following thread state transitions model the lifecycle of a thread?

a. The Dead state to the Ready state
b. The Ready state to the Not-Runnable state
c. The Ready state to the Running state
d. The Running state to the Not-Runnable state
e. The Running state to the Ready state
f. The Not-Runnable state to the Ready state
g. The Not-Runnable state to the Running state



4)
why the run method of class A is called and not of class B

why the o/p is A and not B?
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
alwin, what do you think about these questions? (Hint: Many of them can be quickly verified by checking the API.)
 
Those are the largest trousers in the world! Especially when next to this ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic