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?
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.