File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

best way to create a thread

 
prem ram
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the best way to ceate a thread extending thread class or implementing runnable?
 
Prabhakar Reddy Bokka
Ranch Hand
Posts: 196
Java Oracle Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 1337
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See http://faq.javaranch.com/java/ExtendingThreadVsImplementingRunnable. Either Callable or Future are more functional alternatives than Runnable.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic