Thread class vs Runnable interface | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Thread class vs Runnable interface

Why waste a precious one-class inheritance slot by extending Thread class when we can just implement the Runnable interface?

8th Nov 2016, 12:47 PM
Islay
Islay - avatar
1 Answer
+ 1
Precisely! Don't extend Threads if you don't absolutely have to. Implementing Runnable is definitely the way to go.
8th Nov 2016, 12:48 PM
Schindlabua
Schindlabua - avatar