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

  1. i don't meaning of super.run() , super.handlemessage(msg) necessaary?
  2. 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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -