Groovy web console

subscribe to the feed Subscribe
to this
site
Groovy object array example (via #groovywebconsole)
tweet this snippet Tweet
this
script

Groovy object array example

Published 6 months ago by wololock
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
class People {
    Integer id
}

class Job {
    def func() {
        People[] p = new People[10]
        assert p.size() == 10
        println p
    }
}

new Job().func()