1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

best way for implementing thread in java

Discussion in 'Java' started by khushboo652, Jan 11, 2012.

  1. khushboo652

    khushboo652 Banned

    pls give me the answer which is the best way to implement thread in java runnable interface or inheritance and why?
     
  2. shabbir

    shabbir Administrator Staff Member

    What all ways you have tried and looking for best amont them?
     
  3. virxen

    virxen New Member

  4. dagdu

    dagdu New Member

    By implementing runnable interface is best way to implement.By implementing we can reuse that thread and we can extends any other useful class.
     
  5. alia123

    alia123 New Member

  6. RRT2010

    RRT2010 New Member

    Also you can see if you require to Synchronize the threads. This may be needed if you have many threads running in parallel to avoid concurrency.
     
  7. ifeeleducation

    ifeeleducation New Member

    Use Class is the best way for implementing thread in java
     
  8. shabbir

    shabbir Administrator Staff Member

    On what basis you say it is the best?
     
  9. theglobalassociates

    theglobalassociates New Member

    1.Extending Thread Class
    2.Implementing Runnable Class
     

Share This Page