Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What’s the current state of closures in Java?

Tags:

java

closures

Does anybody know, if closures will be in Java 7?

like image 668
trunkc Avatar asked Sep 22 '08 19:09

trunkc


People also ask

Are there closures in Java?

Java does not have closures. if you then do something like pass f to a function, scope is the scope of where it was defined.

What is Closures in Java programming?

Closures are the inline-function valued expressions which means that they are the class functions with bounded variables. Closures can be passed to another function as a parameter. A closure gives us access to the outer function from an inner function.


1 Answers

It is unknown until the Java SE 7 JSR is created (presumably by Danny Coward) and an expert group is formed and the contents selected.

My Java 7 page is a good collection of links about Java 7 in general and has links to all of the closures proposals and blog entries:

http://tech.puredanger.com/java7#closures

And I maintain a Java 7 link blog where you can find links on closures and other stuff at:

http://java7.tumblr.com

And you might find my Java 7 Predictions blog post to be interesting as well if you want my opinions: http://tech.puredanger.com/2008/08/02/java7-prediction-update/

UPDATE: Mark Reinhold stated at Devoxx in Dec. 08 that closures will NOT be included in Java 7 due to a lack of consensus on how to implement.

like image 62
Alex Miller Avatar answered Sep 30 '22 23:09

Alex Miller