Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section

An agile dynamic language for the Java Platform with many features that are inspired by languages like Python, Ruby and Smalltalk, making them available to Java developers using a Java-like syntax.
Developing web applications , writing shell scripts easily, writing concise, meaningful, test cases using Groovy's JUnit integration, or prototyping and producing real industrial strength applications have never been so concise and groovy.

Groovy works cleanly with all existing Java objects and libraries and compiles straight to Java bytecode in either application development or scripting mode.

A simple hello world script:

Code Block
def name='World'; println "Hello ${name}!"

A more sophisticated version using Object Orientation:

Code Block
class Greeter {
  def name
  Greeter(who) {
    name = who[0].toUpperCase() + who[1..-1]
  }
  def salute() { println "Hello ${name}!" }
}

g = new Greeter('world') // create object
g.salute() // Output "Hello World!"

Leveraging existing Java libraries:

Code Block
import org.apache.commons.lang.WordUtils
class Greeter {
  def name
  Greeter(who) { name = WordUtils.capitalize(who) }
  def salute() { println "Hello ${name}!" }
}

g = new Greeter('world') // create object
g.salute() // Output "Hello World!"

On the command line:

Code Block

groovy -e "println 'Hello ' + args[0]" World

Documentation [more]

Section
Column

User Guide [more]

Children Display
pageGROOVY:User Guide

Advanced Topics [more]

Children Display
pageGROOVY:Advanced Topics
Column

Getting Started Guide [more]

Children Display
pageGROOVY:Getting Started Guide

Testing Guide [more]

Children Display
pageGROOVY:Testing Guide

Developer Guide [more]

Children Display
pageGROOVY:Developer Guide

Cookbook Examples [more]

Children Display
pageGROOVY:Cookbook Examples

...