Interview Questions

What is difference between starting thread with run() and start() method?

Java Interview Questions and Answers (part 4)


(Continued from previous question...)

9.What is difference between starting thread with run() and start() method?

This is quite interesting question, it might confuse you a bit and at time may make you think is there really any difference between starting thread with run() and start() method.

When you call start() method, main thread internally calls run() method to start newly created Thread, so run() method is ultimately called by newly created thread.

When you call run() method main thread rather than starting run() method with newly thread it start run() method by itself.

(Continued on next question...)

Other Interview Questions