Browsing tag: clone

Shallow copy of java objects

Shallow vs Deep Copy of Object by Clone() method


Previous post, we discussed on intention to create copy of object in java. In this post,we would discuss on different implementation of object copying. Before discuss on implementation, let us discuss on basic rule of clone copy implementation. 1) Copy of object and actual object should not refer at same object. If it is same,

java clone.

Intention to Create Copy of Java Objects


Java application created by group of objects. Every time we create object to represent the real time objects. “new” operation creates and builds new object for the class.  But real-time scenario,  we may require to create exact copy of java object in enterprise application.  Below list of use cases to create copy of objects in