• 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 Help Me...For Above Question

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

a. The Thread.join method is static
b. The Thread.join method is always invoked on an instance of Thread
c. The Thread.join method causes the current thread to wait for the referenced thread to die
d. The Thread.join method declares an InterruptedException in the throws clause
e. The Thread.join method accepts a timeout value as an argument
f. The timeout value sets the minimum time that the current thread will wait for the death of the referenced thread
g. Thread.join will return immediately if the timeout value is zero
h. A timeout of zero will allow Thread.join to wait forever if necessary


Ans : b c d e h


Why option g is not selected....
web page

[ December 18, 2008: Message edited by: Thangaraj Raj ]
[ December 18, 2008: Message edited by: Thangaraj Raj ]
 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
because is not guarantee when this method return he will run immediately. do not forget: "with thread there is not guarantee".
by cause this point is letter is false With thread us can not say.

 
Ranch Hand
Posts: 1032
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, the issue is that the meaning of the milliseconds argument is:
If the value of the argument is 0, then wait forever (until the other thread dies.) If it is not zero, wait until the other thread dies, or until the timeout value is reached, whichever comes first. The semantics of the argument are arbitrary in that 0 means "wait as long as it takes."
 
reply
    Bookmark Topic Watch Topic
  • New Topic