java - Better technique for MyThread class -


this question has answer here:

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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -