int[] a = new int[10];
for (int i = 0; i < 10; i++) {
a[i] = randomFill();
}
int[] b = new int[a.length];
for (int j = 0; j < a.length; j++) {
b[j] = a[j]
}
int[] c = new int[a.length];
for(int k = 0; k < a.length; k++) {
c[k] = a[k]
}
- both array b and array c - a deep copy of array a? I need to modify array a, but you want to keep its original values so that I can use it later, and the hint I got was to use a deep copy. I can’t say if my code counts as depth ...
source
share