System.arraycopy() Examples in Java | Java Example Programs

how to copy an array in java

System.arraycopy() Examples in Java | Java Example ProgramsĀ this post we will help you to learn about java.lang.System.arraycopy() Method . arraycopy() method we normally use to copy an array data into an another array. The signatere method is like this:

Parameters :
source_arr : array to be copied from
sourcePos : starting position in source array from where to copy (index starts from 0)
dest_arr : array to be copied in
destPos : starting position in destination array, where to copy in
len : total no. of components to be copied. (index starts from 1)

Example PrgoramĀ :

Thanks for reading this post. if you have any question or comments please write to us. we will love to hear from you.

Leave a Reply

avatar
  Subscribe  
Notify of