Download code

Jump to: navigation, search

Back to Hello_World_(Groovy)

Download for Windows: zip

Download for UNIX: zip, tar.gz, tar.bz2

HelloWorld.groovy

1 printf "Hello World!"
2 (1..10).each { i ->
3   printf i
4 }
5 


HelloWorldClass.groovy

 1 class HelloWorld {
 2   def greet() {
 3      printf "Hello World!"
 4   }
 5   
 6   def printFirstTenIntegers() {
 7      (1..10).each { i ->
 8        printf i
 9      }
10   }
11 }