4

How to create java array of arrays?

I am able to create one dimensional array using

jarray.zeros(10, Object)

I am trying to create outer array with

jarray.zeros(2, Array)

But I got

NameError: name 'Array' is not defined

1 Answer 1

1

The workaround I have is to create list and convert it:

list = []
for x in range(0,2):
    list.append([None] * 10)
javaArray = jarray.array(list, Class.forName('[Ljava.lang.Object;')))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.