first steps


for the newbies to groovy and grails
There are many things for the experts, butfor the newbies, sometimes it´d a hard time, when justa little brick is missing.

I try to show may way to groovy and grails

Wednesday, April 11, 2012

groovy first example: Hello World

the must in every language, teh hello world

println "hello World"

nothing more than this.

make it more complicate
def hello="hello"
def world="world"
println hello+" " +world
println "$hello $world"
Put this in a file  hello.groovy

and command
groovy hello.groovy 
So nice feature,
no ;
no main
no $  (only in the strings)
no ()   after the function println, as long, as all is cllear enough 

And the "def" gives a little more clarity,
other than in PHP,where every varibale, you write $abc or $abd
are varibales implizit declared.

No comments:

Post a Comment