Java-copyOf

copyOf The copyOf() method returns a copy of an array and has the following forms : The original array is specified by source, and the length of the copy is specified by len. If the copy is longer than source, then the copy is padded with zeros, nulls or false. If the copy is shorter … Read more…

Java-arraycopy

arraycopy The arraycopy( ) method can be used to copy quickly an array of any type from one place to another. This is much faster than the equivalent loop written out longhand in java. Program  Program Source public class Javaapp { public static void main(String[] args) { int[] array_v1 = {10,20,30,40,50,60}; int[] array_v2 = new int[4]; … Read more…