java - Better technique for MyThread class -
this question has answer here:
- “implements runnable” vs. “extends thread” 37 answers
better post : "implements runnable" vs. "extends thread"
i can create own thread class mythread 2 ways,
class mythread extends thread or class mythread implements runnable
which technique better , why?
and in case of implementing runnable, have create thread object mythread object, like
mythread mt = new mythread(); thread t = new thread(mt);
then advantage of implementing runnable interface technique?
while creating thread implementing runnable interface better. because can extend new class other class, otherwise can not extend it.
Comments
Post a Comment