Language depth: the "closure" function will be added in Java 7.

Source: Internet
Author: User
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 ;};
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.