aspose file tools*
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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Need help in Threads join " Watch "Need help in Threads join " New topic
Author

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
Sheriff

Joined: Oct 27, 2005
Posts: 19720
    
  20

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:


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
jQuery in Action, 2nd edition
 
subject: Need help in Threads join