Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why start() method

 
Akhil Nagpal
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,
why we call the start() method of the class extending the Thread class instead of run() method.
Akhil
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Calling the start() method will cause the run() method to be called.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
start() sets up threading and makes the run() method run in a separate thread. If you just call run(), it will run in the current thread.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic