public class ArrayUtilities{
public static void main(String[] args){
int[] array1= {1,2,3,4,5,10,15,30,32};
System.out.println(copy(array1));
}
public static int[] copy(int[] array){
int[] newArray = new int[array.length];
for(int i = 0; i < array.length; i++){
array[i] = newArray[i];
}
return newArray;
}
}
I had to write a method to copy an array. THe problem is whenever i run this code it gives me [I@68e4e358, instead of the array. Please help Thank you in advance!