What are the differences between Thread.start() and Thread.run() in Java?

1 Answers
Answered by suresh

Differences between Thread.start() and Thread.run() in Java

When working with multithreading in Java, it is important to understand the differences between Thread.start() and Thread.run() methods:

  1. Thread.start(): This method is used to start a new thread of execution. When Thread.start() is called, a new thread is created and the run() method is executed in that new thread.
  2. Thread.run(): This method is just a normal method of the Thread class. When Thread.run() is called directly, it does not create a new thread and the run() method is executed in the current thread of execution, just like any other method call.

It is important to note that using Thread.run() directly does not provide the benefits of multithreading, as the code will run in the same thread as the caller. To achieve parallel execution and leverage the benefits of multithreading, Thread.start() should be used to start a new thread.

Answer for Question: What are the differences between Thread.start() and Thread.run() in Java?