Groovy
|
Groovy is an object-oriented programming language designed for the Java platform as an alternative to Java with features from Python, Ruby and Smalltalk.
Groovy uses a Java-like syntax which is dynamically compiled to JVM bytecodes and that works seamlessly with other Java code and libraries. The Groovy compiler can be used as an alternative to javac to generate standard Java bytecode to be used by any Java project or it can be used dynamically as a scripting language.
Groovy is currently undergoing standardization through the Java Community Process [1] (http://www.jcp.org/en/jsr/detail?id=241).
Examples
class Foo { doSomething() { data = ["name": "James", "location": "London"] for (e in data) { println("entry ${e.key} is ${e.value}") } } closureExample(collection) { collection.each { println("value ${it}") } } static void main(args) { values = [1, 2, 3, "abc"] foo = new Foo() foo.closureExample(values) foo.doSomething() } }
External links
- Official site (http://groovy.codehaus.org/)de:Groovy