What is the difference between deep and shallow copy?

By ayush goel in 22 Sep 2023 | 04:09 pm
ayush goel

ayush goel

Student
Posts: 346
Member since: 21 Sep 2023

What is the difference between deep and shallow copy?

22 Sep 2023 | 04:09 pm
0 Likes
divas goyal

divas goyal

Student
Posts: 453
Member since: 22 Sep 2023
  • A shallow copy creates a new object but does not recursively copy nested objects within the original object. Changes to nested objects will affect both the original and the copy.
  • A deep copy creates a completely independent copy of the original object and all nested objects, recursively. Changes to the original or its nested objects do not affect the deep copy
22 Sep 2023 | 06:32 pm
0 Likes

Report

Please describe about the report short and clearly.