|
About Java 7.0(Dolphin)
Sun is releasing weekly early access snapshots of the complete source, binaries and documentation for JDK 7. These raw snapshot releases let you review and contribute to the Java SE platform as it is being developed.
Some possible language changes being considered for Dolphin include:
- property support (for getFoo()/setFoo() pattern)
- method references (a quick way to write an event notification pattern)
- block closures (collection of statements within a statement)
- native XML support
New Features
-
Closures
Closures are something like C callbacks, a pointer to a function that you can pass as a parameter. In addition to the method, some context around that method is snapshotted to go along with it in the closure.
Another way of putting it is a closure is an anonymous function body, that can be declared and passed around as a first-class object, and which can refer to variables from its enclosing scope. The anonymous classes in JDK 1.1 provide closure-like facilities, albeit with tacky syntax. Smalltalk "blocks" are closures.
|
|