• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Diffarence between shallow copy and deep copy

 
sarma kiran
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can any one tell me what is the diffarence between Shallow copy and Deep copy with examples.
 
Rajkamal Pillai
Ranch Hand
Posts: 445
1
Java Spring
 
Praveen Kumar
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic