Groovy web console

subscribe to the feed Subscribe
to this

Groovy Hello

Published 8 months ago by Anonymous
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
class speaker {
    def printLn(String string) {
        println string

def talk = new speaker()
// you don't always need a def 

def helloText = "Hello in Groovy"
println "Hello Text:"

def helloArray=["Hello 1!","Hello 2!"]
println "Hello Array:"
helloArray.each { talk.printLn(it) }