Groovy web console

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

Sub class weirdness

Published 4 weeks ago by Dave
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
class X {
    private method(){
        println "method()"
    }
    def pubMeth(){
        1.times{
            method()
        }
    }
}

class Y extends X{
    def pubMeth(){
        super.pubMeth()
    }
}

new Y().pubMeth()