SWP is right. Just to explain in a bit more detail....
An array is an object in Java. When I say byte[] foo = byte[5] I am creating a Java object that holds the 5 byte values. Now when I say Object[] bar = new Object[5] I am creating a Java object which contains 5 object references.
If for instance I have the following:
1 2 3 4
| Object obj1 = new Object(); Object obj2 = new Object(); Object obj3 = new Object(); Object[] objarray1 = new Object[] {obj1,obj2,obj3}; |
Then objarray1 is an object that contains 3 object references, to the 3 objects.
When you create a second 3 element obj array and do a System.arraycopy from the first to the second, it copies the contents of the first array to the second. Since the contents is references, what you get is a second array that has as its elements references to the same 3 objects.
So since arrays are obejcts. A two dimensional array is really a one dimensional array full of references to one dimensional array objects. If you do a System.arraycopy on it all you will get is another object that contains the same references to the same one dimensional array objects.
I hope that helps.
JK