java cloning

Cloning Duplicate Object Marker Interface

We have seen earlier, shallow copying is easier and deep copying takes more time, especially, when properties (variables) are many. Here comes another way of copying, cloning. In cloning, object to object is assigned, but at the same time encapsulation is maintained. Both objects occupy two different locations; that is,…