Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6
Omkar Shinde by extending Thread, each of your threads has a unique object associated with it, whereas implementing Runnable, many threadscan share the same object instance. In the Runnable interface approach, onlyone instance of a class is being created and it has been shared by different threads. source: https://stackoverflow.com/questions/541487/implements-runnable-vs-extends-thread-in-java I hope I was helpful
21st May 2019, 8:40 PM
Alessio Benvenuti
Alessio Benvenuti - avatar