Shallow copy or Deep copy?

前端 未结 6 881
Happy的楠姐
Happy的楠姐 2020-11-27 04:28

I am a bit new to these two methods of copying one object into the other. I am confused and unable to spot out the major difference between deep copy and shallow copy.. I ha

6条回答
  •  没有蜡笔的小新
    2020-11-27 05:12

    Write a couple more lines of code to change the property of the first object after you assign it to the second object. Then call the display method on both objects and see what the results are. This will reveal to you that it is in fact a shallow copy.

提交回复
热议问题