Groovy programming language
Encyclopedia : G : GR : GRO : Groovy programming language
Groovy is an object-oriented programming language designed for the Java platform as an alternative to the Java programming language 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 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 under [JSR 241].
Groovy has a number of features not found in standard Java:
- Static typing and dynamic typing
- Native syntax for lists, maps, arrays, and regular expressions
- Closures
- Operator overloading
Examples
class Foo is $") } }def closureExample(collection) ") } }
static void main(args) }
Comparison between Java code and comparable Groovy code
Java
class Filter } for (String item : shorts) } }
Groovy
list = ["Rod", "James", "Chris"] shorts = list.findAll shorts.each
References
- Dierk Koenig, Guillaume Laforge and Andrew Glover. [Groovy in Action ]. Manning, 2006. ISBN 1932394842.
External links
From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.
