如题
@async 主线程 获取@async声明的返回值,主线程会等待@async函数执行结束吗?
{
texst t = new texst();
int a = t.ax();
System.out.println( a );
}
@Async
public int ax(){
try {
Thread.sleep( 1000 );
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println( "sub" );
return 100;
}