J
Jeremy Watts
hi ,
i've already posted this message in another ng, so excuse the cross post.
i've written a method that returns three 3-dimensional arrays, and my
question is to how to return these arrays without putting them in
another array and returning that. someone mentioned the use of lists, which
i have now successfully implemented, so my three arrays now reside in a list
which is then returned by the method.
my problem now seems how to reference the arrays in the list once the list
has been returned? in the case of simple integer values say being in the
list then this doesnt seem to be a problem. if say the returned list was
'result' , then the values can be displayed by
system.out.println(result.get(0)), system.out.println(result.get(1)) etc..
but what if 'result' now itself contains arrays, then how are individual
entries of these arrays accessed? i've tried accessing the array elements
by using 'system.out.println(result.get(0)[0][0][0]), but this produces an
error message saying i cant treat a java object as an array. could someone
please tell me how to access array elements that are placed in a list??
thanks
i've already posted this message in another ng, so excuse the cross post.
i've written a method that returns three 3-dimensional arrays, and my
question is to how to return these arrays without putting them in
another array and returning that. someone mentioned the use of lists, which
i have now successfully implemented, so my three arrays now reside in a list
which is then returned by the method.
my problem now seems how to reference the arrays in the list once the list
has been returned? in the case of simple integer values say being in the
list then this doesnt seem to be a problem. if say the returned list was
'result' , then the values can be displayed by
system.out.println(result.get(0)), system.out.println(result.get(1)) etc..
but what if 'result' now itself contains arrays, then how are individual
entries of these arrays accessed? i've tried accessing the array elements
by using 'system.out.println(result.get(0)[0][0][0]), but this produces an
error message saying i cant treat a java object as an array. could someone
please tell me how to access array elements that are placed in a list??
thanks