public static void main(String[] args) throws InterruptedException, ExecutionException {
		// 将Callable包装成FutureTask,FutureTask也是一种Runnable
		IntStream.range(0, 3).forEach(i ->{
			FutureTask<String> futureTask = new FutureTask<>(new Callable<String>() {
				@Override
				public String call() throws Exception {
					System.out.println("current thread"+Thread.currentThread().getName());
					return "call";
				}
			});
			new Thread(futureTask).start();
			
			String sum="";
			try {
				sum = futureTask.get();
			} catch (InterruptedException | ExecutionException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			System.out.println(Thread.currentThread().getName() + Thread.currentThread().getId() + "=" + sum);
		});

		// get方法会阻塞调用的线程

	}复制代码