
Groovy is a dynamic scripting language that runs on the Java platform with very similar syntax to Java, along with a number of dynamic features. In fact, most Java syntax is valid Groovy syntax. However, Groovy code can be more compact than Java because it doesn't require many of the elements that Java does. For example (source: Wikipedia), this segment in Java:
for (String it : new String[] {"Rod", "Carlos", "Chris"})
if (it.length() <= 4)
System.out.println(it);
Can be written as in Groovy.
["Rod", "Carlos", "Chris"].findAll{it.size() <= 4}.each{println it}
Some of Groovy's features include:
- Dynamic typing with the def keyword
- Closures
- Operator Overloading
- Native syntax for lists and associative arrays
- Native Support for RegEx
- Polymorphic Iterations
- The ?. operator to auto-check for nulls
Getting Started and Resources:
The Groovy Website
Eclipse Plugin
NetBeans Plugin

New Topic/Question
Reply





MultiQuote


|