Groovy web console

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

Class

Published 3 months ago by Anonymous
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
class A {
    String hello
    A() {
        this.hello = "Hello"
    }
}

class B extends A {
    String world
    B() {
        this.world = ", World"
    }
}

A b = new B()

println b.hello + b.world