Thread class vs Runnable interface | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 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 ответ
+ 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