would this be an example of deep copy?

Viewed 59
int[] a = new int[10];
for (int i = 0; i < 10; i++) {
    a[i] = randomFill();//randomFill is a method that generates random numbers
}

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]
}

are both array b and array c the deep copy of array a? I need to modify array a but want to keep its original values so that I can use it for later and the hint I received was to use deep copy. I can't tell if my code is considered as deep copy ...

2 Answers
Related