aspose file tools*
The moose likes Features new in Java 7 and the fly likes Any new control structures or new aspects  covered in ' The Well Grounded Java Developer'? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Features new in Java 7
Bookmark "Any new control structures or new aspects  covered in Watch "Any new control structures or new aspects  covered in New topic
Author

Any new control structures or new aspects covered in ' The Well Grounded Java Developer'?

charlsy chuks
Ranch Hand

Joined: May 18, 2012
Posts: 79
Thanks Martijn,

That was a quick answer to my question on J2ME . I read that switch statement can now take string cases. Are there any other any changes or new features for existing control structures as we know them in Java 6?
What are functional languages like? Could you throw more light on Clojure, Groovy and Scala. Thank you.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39393
    
  28
Functional languages work largely by returning values, and most functions are called in a sort of recursive mannr.
By new control structures, you might mean try‑with‑resources, or multiple catch types, or the <> in generics.
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Campbell's got it! Our Functional Programming Slideshare presentation might help give you some motivations/understanding for functional programming as a Java developer.


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Palak Mathur
Ranch Hand

Joined: Jan 29, 2007
Posts: 313

Martijn Verburg wrote:Campbell's got it! Our Functional Programming Slideshare presentation might help give you some motivations/understanding for functional programming as a Java developer.


I think I will add it to Clojure FAQ so that it is easier for new learners to Functional Programming to grab the essence.


Palak Mathur | My Blog | TechJaunt | What is JavaRanch? | List of All FAQs
charlsy chuks
Ranch Hand

Joined: May 18, 2012
Posts: 79
Hi

Thanks Guys for the answers guys but I really need to get to the root of this. Functional languages help us write more safer OO code but one of the main features is that code and data are one?
Hmmm that for me looks like potential trouble if you ask me.

Where do we draw the boundaries so we do not mistake? Maybe my questions arise from the fact that I have used non-functional imperative languages. However, I am not biased and I am willing to explore these
new range of functional languages especially Clojure which is also Dynamic.

Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Functional does not trump OO nor visa versa. There are just certain idioms where functional works out better, for example filter, map and reduce type operations that don't alter the original collection. You'll find common places in Java code such as Listeners, Handlers, Callables and Runnables as will as the traditional for loop with an if filter inside of it that are ripe for writing in a more functional manner.

NB: Arguably anonymous inner classes in Java are functional... it's just a clunky syntax :-)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Any new control structures or new aspects covered in ' The Well Grounded Java Developer'?