Return array of integers with jruby

3 views
Skip to first unread message

drio

unread,
Mar 13, 2011, 1:34:36 PM3/13/11
to coding kata
Hi,

I am having problems returning and Array of integers (kata: nasa
countdown) using
jruby. What's the correct syntax to do so?:

require
'java'
java_package
'org.codingkata.unit'
java_import
'org.codingkata.unit.api.IKataSolution'

class
MyKata
java_implements
IKataSolution

# YOUR
IMPLEMENTATION
java_signature 'Integer[] countdown(int
start)'
def
countdown(start)
# code
here

end
end

Thanks,
-drd

Carl Leiby

unread,
Mar 13, 2011, 3:32:43 PM3/13/11
to codin...@googlegroups.com
Have you tried arr.to_java(Integer)

Carl

This email was sent from my phone. In other words at least I have an
excuse for being brief and misspelling everything this time.

Reply all
Reply to author
Forward
0 new messages