Wednesday 17 October 2012

Groovy is full-OO

Unlike Java that hawled us through (and still is) the autoboxing conundrum for primitive types, Groovy simply *is* fully object-oriented. Declare a primitive type such a 2, and you are actually handling an java Integer.

Want to know the really pretty thing about this? You can use stuff like:
def x = 5
def y = 7
and then something like:
def z = x + y
println z => should print 12
or something like:
def z = y.plus(x)
println z => will also print 12

Cool!

Thoughts?

No comments:

Online Marketing
Add blog to our blog directory blog search directory Blog Directory Blogarama - The Blog Directory