This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Diffarence between shallow copy and deep copy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Diffarence between shallow copy and deep copy" Watch "Diffarence between shallow copy and deep copy" New topic
Author

Diffarence between shallow copy and deep copy

sarma kiran
Ranch Hand

Joined: Jul 17, 2008
Posts: 30
Hi,
Can any one tell me what is the diffarence between Shallow copy and Deep copy with examples.
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1

http://www.javaworld.com/javaworld/javatips/jw-javatip76.html

Cheers,
Raj.
Praveen Kumar
Ranch Hand

Joined: Nov 06, 2006
Posts: 133
Shallow copy object and original objects share the member variables.
Object's clone method will do shallow copy.

Where as in deep copy deep copy object and original object will its own member variables. We can get this one by seralisation.
 
 
subject: Diffarence between shallow copy and deep copy
 
Similar Threads
Difference between Shallow copy and Deep Copy in Java
serialization
shallow copy and deep copy
Cloneable and deep copy.
UML History