Reputation:
When I should use
class MyThread extends Thread implements Runnable{
//any statement.
}
And what is the significance of using both type of thread creation at a single time.
Upvotes: 0
Views: 1055
Reputation: 279920
You should almost never do that. The type Thread
already implements Runnable
.
The only reason to do this is if you want to be explicit in your source code.
both type of thread creation
There is only one way to create a thread: creating a Thread
instance and invoking its start()
method. Runnable
is just an interface.
Upvotes: 4