Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

array copy java

// java.util.Arrays.copyOf() method is in java.util.Arrays class.
// It copies the specified array, truncating or padding with false
// (if necessary) so the copy has the specified length.
int[] src = {1,2,3,4};
int[] dst = Arrays.copyOf(src, src.length);

// clone() method.
int[] arrClone = src.clone()
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #array #copy #java
ADD COMMENT
Topic
Name
3+4 =