DEVFYI - Developer Resource - FYI

What is shallow copy or shallow clone in array cloning?

Java Interview Questions and Answers (part 1)


(Continued from previous question...)

154. What is shallow copy or shallow clone in array cloning?

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.

(Continued on next question...)

Other Interview Questions