K
Kiran A K
hi,
consider the following piece of code:
string s1 = "kiran";
string s3 = s1.Clone() as string;
Console.WriteLine(System.Object.ReferenceEquals(s1, s3));
The above piece of code gave me true while i was expecting false.
s3 is a clone of s1. so s1 and s3 should be separate objects right?
as a result, one would expect "ReferenceEquals" to return false...
can anyone pls explain what exactly is happening?
regards,
kiran
consider the following piece of code:
string s1 = "kiran";
string s3 = s1.Clone() as string;
Console.WriteLine(System.Object.ReferenceEquals(s1, s3));
The above piece of code gave me true while i was expecting false.
s3 is a clone of s1. so s1 and s3 should be separate objects right?
as a result, one would expect "ReferenceEquals" to return false...
can anyone pls explain what exactly is happening?
regards,
kiran