Thread vs Runnable interface
"The most important difference is - When you extend a thread each of your threads has a unique object associated with it, whereas with Runnable, many threads share the same object instance."
Can someone explains me how the Runnable interface shares shares same instance more than once?
Re: Thread vs Runnable interface
You can pass a reference to a class that extends Runnable to more than one Thread object.
Code :
Runnable rnbl = new Runnable();
new Thread(rnbl);
new Thread(rnbl);
new Thread(rnbl);
The three threads will share the one Runnable.
Re: Thread vs Runnable interface