回调的核心就是回调方将本身即this传递给调用方
回调 https://www.cnblogs.com/xrq730/p/6424471.html
ExecutorService、Callable 、future http://www.cnblogs.com/xrq730/p/4872722.html
public class CallableTest { public static void main(String[] args) { ExecutorService es = Executors.newCachedThreadPool(); callableThread cThread = new callableThread(); Future<String> future = es.submit(cThread); try{ String str = future.get(); System.out.println(str); } catch(Exception e) { } } } class callableThread implements Callable<String> { @Override public String call() throws Exception { return "lalalall"; } }