码迷,mamicode.com
首页 > 其他好文 > 详细

面试题:你使用过concurrent包下的那些类?

时间:2019-09-28 13:03:26      阅读:214      评论:0      收藏:0      [点我收藏+]

标签:ash   mic   cab   面试   打印   循环   创建线程   ++   int   

1.executor接口,使用executor接口的子接口ExecutorService用来创建线程池
2.Lock接口下的ReentrantLock类,实现同步,比如三个线程循环打印ABCABCABC...
3.atomic包,使用AtomicInteger类的incrementAndGet()方法来实现原子操作,比如a++
4.Callable接口,重写call方法,实现多线程
5.concarrenHashMap,线程安全的HashMap

面试题:你使用过concurrent包下的那些类?

标签:ash   mic   cab   面试   打印   循环   创建线程   ++   int   

原文地址:https://www.cnblogs.com/linliquan/p/11602468.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!