Programmer Question
I have came across many situation where I needed to pass value to an other thread and I founded out that I could do it this way, but I have been wondering how is it working ?
public void method() {
final EventHandler handle = someReference;
Thread thread = new Thread() {
public void run() {
handle.onEvent();
}
};
thread.start();
}
Edit: Just realise my question wasn't exactly pointing toward what I wanted to know. It's more "how" it works rather then "why".
Find the answer here
No comments:
Post a Comment