英文來源於:Java in a Nutshell, 6th Editionjava
Definition of a Lambda Expression A lambda expression is essentially a function that does not have a name, and can be treated as a value in the language. As Java does not allow code to run around on its own outside of classes, in Java, this means that a lambda is an anonymous method that is defined on some class (that is possibly unknown to the developer). ---Java in a Nutshell, 6th Edition正則表達式
其實正則表達式就是沒有名字的函數,(參數,返回值,函數體),在java 語言中視爲一個值. 由於java的函數必須在類中定義,這就意味着,java語言中的函數表達式即爲在某類中定義的匿名方法.shell
函數表達式在java視爲一個值,即:Runnable r = () -> System.out.println("Hello World"); 形式.express