...
| 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. Groovy works cleanly with all existing Java objects and libraries and compiles straight to Java bytecode in either application development or scripting mode. // The Greeter class Code Block | | none |
| 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}!" }
}
// Create a new object
g = new Greeter('world') // create object
g.salute() // Output "Hello World!"
g.salute()
|
Documentation [more]
| Section | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...