Groovy web console

subscribe to the feed Subscribe
to this
site
Groovy script inner class (via #groovywebconsole)
tweet this snippet Tweet
this
script

Groovy script inner class

Published 3 months ago by adovbnya with tags script inner groovy class
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
class InnerHelloWorld {        
    def name         
 
    def greet() {         
        "Hello ${name}"     
    }
}     
 
def innerHelloWorld = new InnerHelloWorld()
innerHelloWorld.name = "Groovy" 
 
println innerHelloWorld.greet()