my dog learned polymorphism
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Please Help Me...For Above Question 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 "Please Help Me...For Above Question" Watch "Please Help Me...For Above Question" New topic

Please Help Me...For Above Question

Thangaraj Selvamani
Ranch Hand

Joined: Sep 20, 2008
Posts: 61
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 ]
camilo lopes
Ranch Hand

Joined: Aug 08, 2007
Posts: 202
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.

Brazil - Sun Certified Java Programmer - SCJP 5 About Java - Update every Week.
Guide SCJP - tips that you need know
Ruben Soto
Ranch Hand

Joined: Dec 16, 2008
Posts: 1032
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."

All code in my posts, unless a source is explicitly mentioned, is my own.
I agree. Here's the link:
subject: Please Help Me...For Above Question
It's not a secret anymore!