public class call {
public static void main(String[] args) throws InterruptedException, ExecutionException {
ExecutorService service = Executors.newFixedThreadPool(1);
Race r=new Race();//实现了Callable接口
Future<Integer> result=service.submit( r);
int number = result.get();
System.out.println(number);
service.shutdownNow();
}
}