假设我们有这个简单的例子:
public Example extends Thread{
String temp;
public Example(){
}
@Override
public void run(){
.
.
.
.
temp = "a_value";
}
public static void main(String[] args) {
Example th = new Example();
th.start();
}
}
线程完成任务后如何将变量temp的值返回给我?
th.start()
。而且你已经实现了一种从线程中返回值的方法。 - Ha.