Deep copy using shallow copy

Can we do deep copy using shallow copy?

It appears you’re confused about the distinction between deep copy and shallow copy. Deep copy is a recursive process used for classes that contain class variables as members. The class’s author has to decide whether a class variable needs deep copying or shallow copying. Class members that are not class variables are always considered shallow copies.

1 Like