Interview Question
- 0of 0 votes
AnswersWhat is the difference between shallow copy and deep copy?
- hr@izetam.com February 02, 2022 in United States
The difference between shallow copy and a deep copy is given below:
Shallow copy stores the references of objects to the original memory address,Deep copy makes a new and separate copy of an entire object with its unique memory address.
Shallow copy is faster,Deep copy is comparatively slower.
Shallow copy reflects changes made to the new/copied object in the original object,Deep copy doesn’t reflect changes made to the new/copied object in the original object| Report Duplicate | Flag | PURGE
C++
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
Interview Type: In-Person
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.