-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Varad_RS
Message 2 in Discussion

Hi Sarada,   In C#, the shallow copy is also referred as memberwise copy.   A shallow 
copy creates a new instance of the same type as the original object, and then copies 
the nonstatic fields of the original object. If the field is a value type, a 
bit-by-bit copy of the field is performed. If the field is a reference type, the 
reference is copied but the referred object is not; therefore, the reference in the 
original object and the reference in the clone point to the same object. In contrast, 
a deep copy of an object duplicates everything directly or indirectly referenced by 
the fields in the object.  
For example, if X is an Object with references to the objects A and B, and the object 
A also has a reference to an object M, a shallow copy of X is an object Y, which also 
has references to objects A and B. In contrast, a deep copy of X is an object Y with 
direct references to objects C and D, and an indirect reference to object N, where C 
is a copy of A, D is a copy of B, and N is a copy of M. 
The Type of the clone is the same as the type of the original Object. 
To mention more, there are 3 types of Copy Constructor in C# 1) Reference Copy 2) 
Memberwise copy or Shallow copy and 3) Deep copy. 
To learn more about C# Copy Constructor check out this nice article 
http://www.phptr.com/articles/printerfriendly.asp?p=25352 
Hope this helps. 
Regards,
Varad.


-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to