guava创建线程池

private static ListeningExecutorService executorService = MoreExecutors.listeningDecorator(Executors.newCachedThreadPool());
public static void main( String [] args) throws InterruptedException {
executorService.submit(()->{
try {
Thread.sleep(300);
System.out.println("abc");
}
catch (Exception ex){
}
});
System.out.println("end");

}
posted @ 2021-05-25 16:31  甜菜波波  阅读(1056)  评论(0编辑  收藏  举报