wood burning stoves
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 Elasticsearch in Action this week in the Big Data 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: 19908

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
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Need help in Threads join