wood burning stoves 2.0
The moose likes Java in General and the fly likes multidimensional array creation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "multidimensional array creation" Watch "multidimensional array creation" New topic

multidimensional array creation

Kelley Koszegi

Joined: Aug 20, 2001
Posts: 27
Here is an array problem I have:
I have two multi-dimensional arrays of the same size & shape, like this:

I want to get an array that looks like this:

How can I do this without explicitly copying each element of the array? It seems like I should be able to "plug" arrayA and ArrayB right into arrayC somehow. Any ideas?

Kelley Koszegi<br />Sun Certified Java Programmer
Steve Deadsea
Ranch Hand

Joined: Dec 03, 2001
Posts: 125
I believe you will have to copy each element. Java arrays are contiguous memory segments, so they cannot be created by mixing non-contiguous peices of memory.
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
I agree. Here's the link: http://aspose.com/file-tools
subject: multidimensional array creation
It's not a secret anymore!