Java Mailing List Archive

http://www.gg3721.com/

Home » user.groovy »

[groovy-user] follow up

Roger Studner

2010-01-31

Replies: Find Java Web Hosting

Author LoginPost Reply
so I wrote this email just a bit ago:
I have a class, with this inner class:

public class PhoneNumber {
 public String fine
 public String fullNumber
}

if I do:

def someMethod() {
def r = new PhoneNumber(fine:"hi", fullNumber:"dog")
}

I get:
Exception in thread "main" groovy.lang.GroovyRuntimeException: failed to invoke constructor: public comp.Outerclass$PhoneNumber(comp.Outerclass) with arguments: [] reason: java.lang.IllegalArgumentException: wrong number of arguments

Umm.. that is the right # of arguments.

Everything is fine if the inner class is static.

but like.. why? I mean, i use/instantiate inner classes all the time in java.. from the parent class, without them being static

Thanks,
Roger



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


©2008 gg3721.com - Jax Systems, LLC, U.S.A.