Two Laptop Bag*
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
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: 19653
    
  18

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help in Threads join
 
Similar Threads
Regarding Threads
join() method
Thread Priority issue
Thread Behaviour? Help!!!
how to use join( )