-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Roark
Message 2 in Discussion
A shallow copy will involve copying all the value and reference types inside the
object. suppose u have a class like Class1 { String str; int x; } A shallow copy
using Clone would create a new instance of Class1. The value type x would be copied.
So any changes to 'x' would not get reflected. But since this is a Shallow copy,
only the object reference of 'str' would be copied and not the actual data. i.e the
pointer(address or reference) to the actual object would be copied. So any
manupulations on 'str' in the new clone would get reflected in the original object.
This is true of any reference type. Remember that a clone will create a new object
with its own memory space for a Class but a simple assignment statement would only
copy the object reference and NOT create a new object. In case of a deep copy we
would have copied both the value type 'x' and a new String object would have been
created with its contents having the same string value. But since we create a new
object of Stirng any modifications to the new object would never get reflected in the
original object in case of a Deep Copy.
-----------------------------------------------------------
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]