Intermediate Object-Oriented Programming Concepts
Q60 / 100

In OOP, what is a "shallow copy" of an object?

Correct! Well done.

Incorrect.

The correct answer is A) A copy where the top-level object is duplicated, but nested objects are shared by reference with the original

A

Correct Answer

A copy where the top-level object is duplicated, but nested objects are shared by reference with the original

Explanation

Shallow copies create a new top-level object but reuse references to nested objects, so changes to nested data affect both copies.

Progress
60/100