multidimensional String Array copy
1 posts in topic
Flat View  Flat View

Posted By:   manav_aggarwal
Posted On:   Wednesday, June 6, 2001 02:58 AM

I have a String defined as String one[][][] and I want to make a copy of it. How do I do that? I think clone() won't work here?

Re: multidimensional String Array copy

Posted By:   Thanigai_Venkatesan  
Posted On:   Thursday, June 7, 2001 11:30 AM

Copying elements from One Array to Another Array can be done using

System.arraycopy(src, 0, dst, 0, Math.min(src.length, dst.length));

src - name of the source Array from where it has to copy.

0 - Starting Index from where it has to start in source array.

dst - name of the destination Array to where it has to copy.

0 - Starting Index in the destination Array from where it will get copied.

Math.min(src.length, dst.length) - the number of elements to be copied is determined by the length of the array which has minimum.

Hope this will helping you in copying the array. If you still have problem let me know, we can try to figure out.


About | Sitemap | Contact