Introduction to Functional Interfaces – A concept recreated in Java 8 Any java developer around the world would have used at least one of the following interfaces: java.lang.Runnable,java.awt.event.ActionListener, java.util.Comparator,java.util.concu…
一,Condition 一个场景,两个线程数数,同时启动两个线程,线程A数1.2.3,然后线程B数4.5.6,最后线程A数7.8.9,程序结束,这涉及到线程之间的通信. public class ConditionTest { static class NumberWrapper { public int value = 1; } public static void main(String[] args) { //初始化可重入锁 final Lock lock = new ReentrantL…