What is shallow copy or shallow clone in array cloning?

Q

What is shallow copy or shallow clone in array cloning?

✍: Guest

A

Cloning an array invloves creating a new array of the same size and type and copying all the old elements into the new array. But such copy is called shallow copy or shallow clone because any changes to the object would be reflected in both arrays.

2012-09-05, 2075👍, 0💬