Copies the contents of an array to another array
public class SystemExample {
public static void main(String[] args) {
int arr1[] ={1,2,3,4,5};
int arr2[] = new int[5];
System.arraycopy(arr1, 0, arr2, 0, 5);
for (int i = 0; i < arr2.length; i++) {
System.out.println(arr2[i]);
}
}
}
Tags: java.lang, java.lang.System, System, System examples
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Leave a Reply