This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes About the join() method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "About the join() method" Watch "About the join() method" New topic

About the join() method

Milton Ochoa
Ranch Hand

Joined: Oct 23, 2007
Posts: 336

Hi everyone,

Today i was studing about Threads...

Can someone explain me about the method "join()"

I know it a few but i not sure if my aknowlege is wrong.

This is what I thing about the join() method:

lets see this code:

I thing that when the join method of the thread t run, put back the main thread (with BACK i mean in the wainting/bloqued State. <- this is correct???) And run the threat t freely, maybe with another thread to the same time (another threads moving the threads back and forth between the runnable state and the running state.)

Thank you
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
Your code starts a new thread, then asks the main thread to wait (blocked, but interruptible) until the new thread finishes.

Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Milton Ochoa
Ranch Hand

Joined: Oct 23, 2007
Posts: 336

Now i know about the join method

very thankz
jQuery in Action, 2nd edition
subject: About the join() method
Similar Threads
Reg. Some Thread basics
J@Whiz question
Whizlabs Thread Question
Regarding Join method in Threads