0

I'm trying to figure out how to define an array of arbitrary dimension.

I have input in the form of an array list such as arr = {1, 2, 3}. This array list could contain any n number of elements. For the example arr, I need to define an array object[1][2][3].

I'm not really sure how to get started on this. Is this even possible?

Jess
  • 31
  • 1
  • 7
  • 1
    See http://stackoverflow.com/questions/17479241/how-to-create-a-nested-array-of-arbitrary-depth-in-java – Mihai8 Oct 10 '15 at 22:40
  • Did you see this post ? http://stackoverflow.com/questions/7969023/from-arraylist-to-array – Yassin Hajaj Oct 10 '15 at 23:01
  • Actually, for the example you cite, you only need one dimension. `int[] arr = {1,2,3};` is valid. If you need an array of any *size*, look at ArrayList. – markspace Oct 10 '15 at 23:06

0 Answers0