This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes Need help in Threads join Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Need help in Threads join " Watch "Need help in Threads join " New topic

Need help in Threads join

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hi ,
I am starting two threads from a Normal Java class .
The Threads are namely One and Two .
I want Thread "Two" to start only after One has completed its execution .

This is my Code , but it isn't working .Please help .

Is this possible to achive ??

Save India From Corruption - Anna Hazare.
Rob Spoor

Joined: Oct 27, 2005
Posts: 20048

You don't need two threads for this. After all, One and Two don't need to be executed in parallel. Just create one Runnable. If for some reason you cannot or will not join the two classes in one you can wrap them:

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: Need help in Threads join
It's not a secret anymore!