dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Java
Expertise: Intermediate
May 4, 2020

Copy an Array

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); 
Octavia Anghel
 
Thanks for your registration, follow us on our social networks to keep up-to-date