dcsimg
 

Submitted by: Octavia Anghel(octaviaanghel@gmail.com)

Monday May 4th 2020 by Octavia Anghel

Language: Java, Expertise: Intermediate: Use this quick approach for copying an array in Java via System.arraycopy.

Use this quick approach for copying an array in Java via System.arraycopy, as shown below:

int[] array = {1, 23, 5};
int[] copiedArray = new int[3];
 
System.arraycopy(array, 0, copiedArray, 0, 3); 
Home
Mobile Site | Full Site