In Java, what is the impact of calling run method and not the start method on a Thread?

In Java, what is the impact of calling run method and not the start method on a Thread?

Ninja Asked on 18th September 2018 in Java.
Add Comment
1 Answer(s)
Best answer

If you directly call run() method its body is executed in context of current thread. When you invoke start() method a new thread is created and run() method is executed in this new thread. The run() method is just an ordinary method (overridden by you). As with any other ordinary method, calling it will cause the current thread to execute run() and not a new separate thread. The start() method will spawn a new thread and let the newly spawned thread execute run().

Ninja Answered on 18th September 2018.
Add Comment