Home » Tip Bank » Java
  • Comment on this Article
Language: Java
Expertise: Intermediate
May 4, 2020

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Watch

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
 
Submit a Tip
Browse "Java" Tips
Browse All Tips
sitepoint.com
w3.org