2022年3月31日

定时器

摘要: public class TimerDemo01 { public static void main(String[] args) { //1. 创建Timer定时器 Timer timer = new Timer();//定时器本身就是一个单线程 //2. 调用方法,处理定时任务 timer.sc 阅读全文

posted @ 2022-03-31 11:17 我要当程序源 阅读(81) 评论(0) 推荐(0) 编辑

线程池处理 Callable任务 执行完毕都得到返回值

摘要: public class ThreadPoolDemo01 { public static void main(String[] args) throws Exception{ ExecutorService pool = new ThreadPoolExecutor(3,5,6, TimeUnit 阅读全文

posted @ 2022-03-31 10:50 我要当程序源 阅读(164) 评论(0) 推荐(0) 编辑

导航