-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: rags_rao
Message 4 in Discussion
oops! made a mistake there. strings r referece types and not value types (and nobody
corrected me?). sting s = "something"; modify(s) consolewrite(s); // o/p something
modify(string s) { s = "something else"; } this happens becoz string r immutable
(i dont want u xpln what immutable is check msdn or java docs - concepts r same there
too) so when s is modified a new insatance is created and the refererce (&) is
assigned to s. ofcourse when fn returns value of s is lost (stack is poped) but the s
in calling fn still points to old reference. so writeline outputs something for
those who dont know how strings work this will be confusing (it will be even after u
do - like it did to me and also because i have given such a lousy explaination)
ok......... i can do better play arround with
string.equals(),object.equals(),object.referenceequals() x= "xxx"; y= "xxx"; w=x; u
will see that all 3 point to same memory location x="yyy"; now both y,w have same
refernce (inspite of w=x) and x point to a new location that has string "yyy" i
believe if u have another string with value "yyy", nomatter where it is declared (as
long as its in same appln domain) it will contain same refernce as x
-----------------------------------------------------------
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]