How many ways to create Thread and which is better?

There are two ways to create Thread:
  • By extending java.lang.Thread class and
  • By implementing java.lang.Runnable interface
Which one is better?
We can't say which one is better but only difference is that:
  • When you extends Thread class you can't extends some other classes but
  • When you implement Runnable interface you can implement some other java class also

9 comments :

  1. Thanks..please go through this blog also explained good http://adnjavainterview.blogspot.in/2014/06/how-many-ways-to-create-thread-in-java.html

    ReplyDelete
  2. This is good ideas that gives good learning in doing some programs with the use of some JavaScript. A very simple way to create a thread is what you have show in your blog, and it was nice to hear about this.

    ReplyDelete
    Replies
    1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training India . Nowadays Java has tons of job opportunities on various vertical industry.

      Delete
  3. Finding the time and actual effort to create a superb article like this is great thing. I’ll learn many new stuff right here! Good luck for the next post buddy..
    White Label Website Builder

    ReplyDelete
  4. Nice and good article.. it is very useful for me to learn and understand easily.. thanks for sharing your valuable information and time.. please keep updating.morephp jobs in hyderabad.
     

    ReplyDelete
  5. Your new valuable key points imply much a person like me and extremely more to my office workers. With thanks; from every one of us.
    Java Training in Bangalore|

    ReplyDelete
  6. Thank you a lot for providing individuals with a very spectacular possibility to read critical reviews from this site.


    Besant Technologies

    ReplyDelete
  7. • Appreciation for really being thoughtful and also for deciding on certain marvelous guides most people really want to be aware of. AWS Training in Bangalore

    ReplyDelete
  8. Thanks a lot very much for the high quality and results-oriented help.
    I won’t think twice to endorse your blog post to anybody who wants
    and needs support about this area.


    Selenium Training in Chennai

    ReplyDelete