So doubt goes increasing for a new programmer. Two ways to doing same thing ? why these necessity exists Let them clarify

Noted : Java provide inheritance . So we can use on class property inside another class by extending class. Consider class MN has method addSum(), iNeedMn want to use this addSum() then simple iNeedMn extends MN is solution. This is called single inheritance

Consider now iNeedMn want to access the property of Thread class also (So called multiple Inheritance(is not allowed in JAVA) i.e one class can extends any number of class) or say iNeedMn need to be use as Thread somewhere. Impossible ???

Cause of providing two to make a thread is to avoid impact of banned multiple inheritance.We can not extends two classes but we can implement any number of interface

Which way to prefer ?

Implementing Runnable is preferred way.It's generally discouraged to extend the Thread class. The Thread class has a lot of overhead and the Runnable interface doesn't