I am fairly new to the concept of multithreading and there is an aspect which is not clear to me.
There are two ways to create and run a thread:
- Extend a Thread class and
start()
the thread. - Create a Runnable object, pass it to a
Thread
constructor andstart()
the thread.
And this blog post states that we always should start a thread using a start()
or so was my impression of it.
But in one of the answers here you could see how a person is using runnable.run()
. It gives me an impression of somewhat wrong practice.
Is it normal? Should it be avoided? You can be explicit in your answer, but any suggestions would be appreciated.