package java.lang;
/**
* The Runnable interface should be implemented by any
* class whose instances are intended to be executed by a thread.
*/
@FunctionalInterface
public 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.
*/
public abstract void run();
}
public class Test {
public static void main(String args[]) {
new Thread(()->{
System.out.println("Runnable 的 lambda 写法!");
}).start();
}
}
原文:https://www.cnblogs.com/feiqiangsheng/p/15225928.html