Why there are two ways for creating threads?
Printable View
Why there are two ways for creating threads?
Because java doesn't support Multiple Inheritance... You can make a thread by making your class a subclass of Thread(extends Thread), but I your class is already a subclass of something other you cannot use the "extends Thread" any more. In that case there is option 2: Implementing Interface Runnable which let you also create a thread. You are not restricted using Interfaces, a class you create can only extend one superclass, but can Implement more than one Interfaces.
And hey that what's programming is all about... You can do the simplest thing is way more than one way!!
If I can give you a hint, focus on the implementing interfaces for creating threads, I find it the best way, u can always use this way!!
Peace
You are absolutely right!