点击上方“朱小厮的博客”,选择“设为星标”做积极的人,而不是积极废人来源:http://uee.me/aWWS21. 用法示例:最普遍的一个例子,执行一个线程new Thread(() -> System.out.print("hello world")).start();-> 我们发现它指向的是 Runnable接口@FunctionalInterfacepublic interface Runnable { /** * When an object implementing interface Runnable is used * to create a thread, starting the thread causes the object's * run method to be called in that separately executing * thread. * * The general contract of the method run is that it may * take any action whatsoever. * * @see java.lang.Thread#run() */ public abstract void run();}分析->这个箭头是lambda表达式的关键操作符->把表达式分成两截,前面是函数参数,后面是函数体
………………………………