Copying an object involves getting another object with the same properties of the original. Here, there exists two ways â€“ two objects having their own set of properties (instance variables) or both objects referring the same location of properties. Following gives the detailed discussion.
Shallow copying is the easier of the two styles; here, one object is assigned with another. When assigned, both objects refer the same location of variables. When both objects refer or share the same location, the minus point is if one object changes the value, the other object also gets affected. That is, to say straight is no encapsulation exists. One small advantage is memory is less used.