Groovy web console

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

GroovyScriptWithInnerClass

Published 9 months ago by dav with tags inner class groovy script
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
class HelloWorld {         
    def name          
    
def greet() {          
        "Hello ${name}"      
    } 
}      

def helloWorld = new HelloWorld() 
helloWorld.name = "Groovy"  

println helloWorld.greet()