public static void copyList(int[]list) {
int [] copyList = new int[list.length]; //define new array
for(int i = 0; i < list.length; i++){
copylist[i] = list[i];
}
System.out.println("The copy is: " + Arrays.toString(copyList) );
}
Hello Everyone. Having trouble writing this method. Do you have any suggestions on how I can improve this code? Am I in the right direction?
Thanks! -Patrick