Generally thread can be created in 2 ways
- Extending a thread class
- Implementing a Runnable interface
By reading in all tutorials, all says that implementing a Runnable interface is always good since you cannot extend any other class if you create by extending(1st method) I agree. And also if we create thread by extending then every thread will create new object whereas if we create thread by implementing all thread will share the same object.
My question is if implementing Runnable is best option and extending thread is bad practice why java have this option? I believe there must be surely some advantage if we create thread by extending ( I believe we should use extending thread method, when there is no other parent class is not the only answer )
Thanks in advance