假设我有两个类,Main 类和 Worker 类
class Main implements StateChangeListener extends JFrmame{
public void notifyMe(State state){
//Change the GUI according to the state
}
}
class Worker extends Thread{
public StateChangeListener listener;
public void run(){
listener.notifyMe(state);
}
}
我的问题是:假设工作者在另一个线程中运行,哪个线程将运行函数notifyMe()?
主线程还是工作线程?谢谢你