Language depth: the "closure" function-general Linux technology-Linux programming and kernel information will be added in Java 7. The following is a detailed description. Nowadays, more and more dynamic languages such as Python and Ruby have been welcomed. Groovey has also been derived from Java, and "closures" are supported in these languages. In the future, the latest version of Java will be released, and the "closure" function (closure) will be added ).
Closures exist in languages like Groovy, Python, and Ruby. languages like Java, C ++, and C # do not support closures. What Are closures? As mentioned in the previous article, "an object is a process-related data, and a closure is a process-related data ". It sounds a little abstract. To put it simply, closure is a block. Below is a piece of code in the Java7 draft Specification that contains the close package:
CODE: int (int) plus2b = (int x) {return x + 2 ;}; |