#!/usr/bin/env groovy
class AA {
def msg
AA(something){ msg = something }
}
def c = { a, b ->
def x =a.newInstance(b)
println x.msg
}
c(AA, "foo")
Or how about....
#!/usr/bin/env groovy
def m = java.lang.String
def n = m.newInstance("foo")
println n