Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Is string reference type / value type?

Answer Posted / ak

How do you explain this then?

public void MyTest()
{
Program myClass = new Program();
myClass.value = 1;
Console.Out.WriteLine(myClass.value.ToString
()); //1
Program newClass = myClass;

newClass.value = 2;
Console.Out.WriteLine(myClass.value.ToString
()); //2


myClass.strvalue = new String("1".ToCharArray
());

Console.Out.WriteLine(myClass.strvalue); //1
newClass.strvalue = myClass.strvalue;

newClass.strvalue = "2";
Console.Out.WriteLine(myClass.strvalue); //2
}

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is full assembly reference

1022


What is the process of Serialization?

1036


Does c# do array bounds checking?

1025


When can a derived class override a base class member?

950


What is form feed in c#?

984


How do you comment out code in c#?

956


What is window application in c#?

1000


Are c# constructors the same as c++ constructors?

989


Illustrate serialization?

1016


Can list contain duplicates c#?

943


How do I move from one form to another in c#?

932


What is firstordefault c#?

995


what is IDisposal interface,IComparable,IEquatable,IFormatable

1069


Define a manifest in .net?

1059


What is the namespcae generally given to the webpage of the .NET Framework ?

1119