It's not a secret anymore!
The moose likes Threads and Synchronization and the fly likes best way to create a thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "best way to create a thread" Watch "best way to create a thread" New topic

best way to create a thread

prem ram

Joined: May 24, 2010
Posts: 3
what is the best way to ceate a thread extending thread class or implementing runnable?
Prabhakar Reddy Bokka
Ranch Hand

Joined: Jul 26, 2005
Posts: 193

Implementing runnable is the best way since you will get a chance to extend other class.
When you are working with AWT/Swing you must have to do this using runnable.
Otherwise it doesn't make much difference.

Lester Burnham

Joined: Oct 14, 2008
Posts: 1337
See Either Callable or Future are more functional alternatives than Runnable.
I agree. Here's the link:
subject: best way to create a thread
jQuery in Action, 3rd edition