Tuesday, June 24, 2008

-C-O-N-C-E-P-T- Series : Java

Object's Shallow Copy and Deep Copy in Java:


Understanding concept:
Suppose I have following two objects:



Shallow copy: "obj2" refers to the memory block pointed by "obj1" as shown below.



Deep Copy: Here the data is actually copied over from "obj1" to "obj2" as shown below.



Java code:



(You can click on image to enlarge it)

Output:



Any comments are always welcome :)

5 comments:

Anonymous said...

Well done for this wonderful blog.

Anonymous said...

This topic have a tendency to become boring but with your creativeness its great.

Anonymous said...

I like your blog

Anonymous said...

I will pass on your article introduced to my other friends, because really good!

Anonymous said...

After reading the information, I may have different views, but I do think this is good BLOG!


_________________________________________________________________________________________________________________

"Look at the sky. We are not alone. The whole Universe is friendly to us and conspires only to give the best to those who dream and work."

- Dr. A P J Abdul Kalam
_________________________________________________________________________________________________________________