android - What does super.run() mean within a thread in Java? -
i don't meaning of super.run();
andsuper.handlemessage(msg);
necessaary?
where should code written? before super.run();
/super.handlemessage(msg);
or after them?
new thread(){ @override public void run() { super.run(); } }.start();
/
handler handler = new handler() { @override public void handlemessage(message msg) { super.handlemessage(msg); } };
question
- i don't meaning of
super.run()
,super.handlemessage(msg)
necessaary?- where should code written? before
super.run()
or after them?
answer - 1
this unnecessary in code in question.
new thread(){ @override public void run() { super.run(); } }.start(); public class thread implements runnable { ... @override public void run() { if (target != null) { target.run(); } } ... }
super.run
call thread
class. therefore, not necessary because there empty function.
answer - 2
please refer answer -1, don't have worry it.
however, if super.x
implemented, have write code depends on function.
Comments
Post a Comment