|
Re: [jruby-user] Creating Java arrays: msg#00158lang.jruby.user
Ah, Matt's answer was what I was looking for...I had no idea how to specify the type of the array to be created, particularly when that type was a primitive type. (Somehow I'd completely missed the Wiki, too...oops.) Thanks! On Nov 18, 2007 10:31 AM, Matt Fletcher <fletcher@xxxxxxxxxxxxxxxx> wrote: > It took me a while to find this as well. I think I eventually got my answer > from the JRuby Cookbook pages on the wiki. > > Anyway, try this: > ["a", "b", "c"].to_java(:String) > > The parameter you give to to_java is the Java type you want the Java array > to be. > > > > On 11/18/07, Scott Davies <scottd@xxxxxxxxx> wrote: > > > > > > > > Simple JRuby newbie question: how do you create a Java array of a > > particular Java type in JRuby? I haven't seen any mention of this in > > the docs I've managed to find, and trying to search over the mailing > > list archive on Codehaus currently makes the site barf ("application > > error"). > > > > Thanks, > > > > -- Scott > > > > > > --------------------------------------------------------------------- > > To unsubscribe from this list please visit: > > > > http://xircles.codehaus.org/manage_email > > > > > > --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [jruby-user] JRuby class arguments: 00158, Patrick Logan |
|---|---|
| Next by Date: | Re: [jruby-user] Incomplete HTTPS response from Microsoft IIS servers: 00158, Chiaming Hsu |
| Previous by Thread: | Re: [jruby-user] Creating Java arraysi: 00158, Matt Fletcher |
| Next by Thread: | [jruby-user] Incomplete HTTPS response from Microsoft IIS servers: 00158, Chiaming Hsu |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |