Thread | SoloLearn: Learn to code for FREE!

0

Thread

What is the difference between thread.start(); and thread.run(); ?

2/28/2019 2:46:35 AM

Aamir Naseer

2 Answers

New Answer

+3

If you call thread.start(), a new thread instance is created and the internal Runnable's run() method is invoked. If you call thread.run(), the internal Runnable just executes on the existing thread. In order to multithread, you will want to start new threads and exeucte Runnables separately, instead of running them all on the same thread.

0

what are the threads ?