Difference between Start and run method in Java thread

Tutorials Shared by the Internet Community

Advertisements

  Top Tutorials     New Tutorials     Submit     Login     Register  

Tutorial Detail

Difference between Start and run method in Java thread

Since start() method calls run() method indirectly, programmer often ask why not directly call run method. well difference between calling run from st
http://javarevisited.blogspot.com/2012/03/difference-between-start-and-run-method.html
  • Total Hits: 14462

  • Average Rating :
    URL RatingURL RatingURL RatingURL RatingURL Rating

  •  

  • Total Votes: 152 votes

  • Category: JAVA/Core JAVA

  • Submitted on: 2012-07-14 14:24:34

  • Submitted By: Javin Paul

  • Set as Favorite

Description:

Since start() method calls run() method indirectly, programmer often ask why not directly call run method. well difference between calling run from start() and run() is that, start first creates a new thread and then call run() method on new thread while if you call run() method directly than it will be called on same thread and no new thread will be created.    More detail...

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 36.18%  55
 Two starsTwo star  Vote LeftVote MiddleVote Right 9.21%  14
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 11.18%  17
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 11.18%  17
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 32.24%  49

Caste Your Vote

 Rating  Selection  Guidelines
 Poor:     Very disappointing, useless.
 Fair:     Below average, disappointing but not useless.
 Good:     About average in its class.
 Very Good:     Above average for its category.
 Excellent:     One of the best Tutorials in its category.






Advertisements