As per Object Oriented Programming, its better to use Runnable instead of extending thread, since we are not really specializing Thread’s behavior here. We are just interested in giving a unit of work (a runnable) to Thread.
So Composition (by implmenting Runnable and giving it to thread) makes more sense here rather than Inheritance (which is meant for specializing thread’s behavior by overriding its run method).