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

15 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
  9. Thanks for one marvelous posting! I enjoyed reading it; you are a great author. I will make sure to bookmark your blog and may come back someday. I want to encourage that you continue your great posts, have a nice weekend!

    Java Training in Bangalore

    ReplyDelete
  10. I really appreciate the information shared above. It’s of great help. If someone wants to learn Online (Virtual) instructor lead live training in #ALFRESCO, kindly contact us http://www.maxmunus.com/contact
    MaxMunus Offer World Class Virtual Instructor-led training on #ALFRESCO. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ pieces of training in India, USA, UK, Australia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain, and UAE etc.
    Avishek Priyadarshi
    MaxMunus
    E-mail: avishek@maxmunus.com
    Skype id: avishek_2.
    Ph:(0) 8553177744 / 080 - 41103383
    http://www.maxmunus.com/

    ReplyDelete
  11. • 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. Power Bi Online course

    ReplyDelete
  12. I wish to show thanks to you just for bailing me out of this particular
    trouble.As a result of checking through the net and meeting
    techniques that were not productive, I thought my life was done.


    java Training in Bangalore



    java training in chennai

    ReplyDelete
  13. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.

    AWS TRAINING IN BANGALORE


    ReplyDelete
  14. This is an excellent blog thanks for sharing valuable information with us please check it once at MSBI Online Training Hyderabad

    ReplyDelete