• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Closures in Java

 
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OMG! I was frequently ignoring the e-mail about this Java Programming Cookbook promotion until I saw that the author was Herb Schildt. Hehehe.

Anyway, I would like to ask about "Closures". As I have heard, it's going to be(or already is) supported in Java 7? If so, what is it for? How does it help me as a developer? Could you provide an example?

From what I understand, a technical cookbook usually provides some ready-made codes? Is this what the book is about?


Thanks!
 
Author
Posts: 253
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim:

At this time I can't comment on what might or might not be in Java 7. Its just too early.

As to what's in my cookbook: Yes, there are a lot of code examples, lots of options, and lots of alternatives.

See the book's page on the McGraw-Hill website for the table of contents and Chapter 1.

An example recipe can be found on my website by clicking on the book's title on the homepage. Then, near the end of the book's description is a link to a sample recipe.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Closures may be included in JDK 7, or JDK 8. There are a couple specific proposals for adding closures that are being discussed. Whether, how, and when they get added is yet to be determined. There is a prototype JDK available from Neal Gafter which supports closures. It's still a work in progress, with numerous bugs and bug fixes, and it's not an official Sun JDK. It's just one guy's demonstration of how closures could be implemented. Of course it's one guy who for several years was the primary author of Sun's javac compiler, and the proposal he's been working on is also supported by James Gosling, Gilad Bracha, and Peter von der Ahe. So it's not just one crazy guy in a garage. But ideas for how closures in Java should work are still evolving, and the final form (if there is one) may be somewhat different, and may stil be a few yearrs away. Recall that it took quite awhile for generics to make it into the language - this may be similar.

You may want to see this nice long talk from Neal, and this list of resources.
 
A "dutch baby" is not a baby. But this tiny ad is baby sized:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic