假设我们有这个简单的例子:
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();
}
}
Run Code Online (Sandbox Code Playgroud)
Thread完成工作后怎么能给我返回String temp?