Copying array to another array
Sometimes it is required to copy array to another array, how can we do that?
Here is the things,
In the java.lang.system class we have System.arrayCopy(-,-.....); we can utlize these method to copy the array.
Here is the method : System.arraycopy(src, srcPos, dest, destPos, length);
Here we have 2 array fields , which we need to copy into the String [] finalfields array.
Calculating the finalfields array size
Here we have copied the "userField" array values into the "finalfields" array values.
Finally we copied the "addressFields" into the "finalfields" array.
so the "finalfields" array contains both "userField" and "addressFields" values.
Thank you.it is really helpful.
ReplyDeleteCheck out these 5 Secrets: How To Use professional resume writing service To Create A Successful Business(Product)