
【Java基础】
低头做事_抬头做人
这个作者很懒,什么都没留下…
展开
-
java线程顺序执行方法
使用join方法实现public static void main(String[] args) { Thread thread1 = new Thread(() -> { System.out.println("thread1"); }); Thread thread2= new Thread(() -> { try { thread1.join();原创 2021-06-04 14:07:05 · 358 阅读 · 0 评论 -
CountDownLatch
CountDownLatch是一个同步工具类,它允许一个或多个线程一直等待,直到其他线程的操作执行完后再执行。CountDownLatch是在java1.5被引入的,跟它一起被引入的并发工具类还有CyclicBarrier、Semaphore、ConcurrentHashMap和BlockingQueue,它们都存在于java.util.concurrent包下。CountDownLatch这原创 2017-01-05 11:11:29 · 214 阅读 · 0 评论 -
Java SE 8 Lambda Expressions
Lambda ExpressionsOne issue with anonymous classes is that if the implementation of your anonymous class is very simple, such as an interface that contains only one method, then the syntax of an转载 2017-01-13 14:57:06 · 312 阅读 · 0 评论