t.start()
is the method that the library provides for your code to call when you want a new thread.
r.run()
is the method that you provide for the library to call in the new thread.
Most of these answers miss the big picture, which is that, as far as the Java language is concerned, there is no more difference between t.start()
and r.run()
than there is between any other two methods.
They're both just methods. They both run in the thread that called them. They both do whatever they were coded to do, and then they both return, still in the same thread, to their callers.
The biggest difference is that most of the code for t.start()
is native code while, in most cases, the code for r.run()
is going to be pure Java. But that's not much of a difference. Code is code. Native code is harder to find, and harder to understand when you find it, but it's still just code that tells the computer what to do.
So, what does t.start()
do?
It creates a new native thread, it arranges for that thread to call t.run()
, and then it tells the OS to let the new thread run. Then it returns.
And what does r.run()
do?
The funny thing is, the person asking this question is the person who wrote it. r.run()
does whatever you (i.e., the developer who wrote it) designed it to do.