Asked by Jennifer LopezRamos on Jul 20, 2024

verifed

Verified

A ____________ copy of an object is a copy that has no references in common with the original object.

A) bit copy
B) deep copy
C) shallow copy
D) none of the above

Deep Copy

Creating a new compound object and then, recursively, inserting copies into it of the objects found in the original.

  • Acquire knowledge on the distinctions between shallow and deep copying techniques in object-oriented programming contexts.
verifed

Verified Answer

EA
Emmanuel AbastaJul 26, 2024
Final Answer :
B
Explanation :
A deep copy is a copy that not only creates a new object but also recursively copies all objects that are referenced by the original object. This ensures that there are no shared references between the original object and the copy. A shallow copy, on the other hand, only creates a new object with references to the original object's children, rather than creating new copies of those children. A bit copy simply copies every bit of data, including references, which can lead to objects that still share references with the original. Therefore, the best choice for a copy with no shared references is a deep copy.