Get your CodeRanch badge!*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Doubt with join() method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Doubt with join() method" Watch "Doubt with join() method" New topic
Author

Doubt with join() method

Gitesh Ramchandani
Ranch Hand

Joined: Feb 28, 2007
Posts: 274
Source: Dan Chisholm

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
Doubt: why is option f wrong?

Thanks,
Gitesh
Alex Belisle Turcot
Ranch Hand

Joined: Apr 26, 2005
Posts: 516
The description in the API of the join :
Waits at most millis milliseconds for this thread to die. A timeout of 0 means to wait forever.


Regards,
Alex
Gitesh Ramchandani
Ranch Hand

Joined: Feb 28, 2007
Posts: 274
so is this correct then:

The timeout value sets the minimum time that the current thread will wait for the death of the referenced thread


Gitesh :roll:
Dean Jones
Ranch Hand

Joined: Dec 29, 2007
Posts: 129
Can someone please explain me the meaning of the following statement in regard to join method.

A timeout of 0 means to wait forever.
Thanks in advance.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt with join() method
 
Similar Threads
Thread doubt
Please Help Me...For Above Question
dan exam doubt 20
doubts regarding join from dans mock
reference variable doubt