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

Is there any sample c# code for simple threading?

919


How do I develop c# apps?

909


What is the difference between function and method in c#?

896


Is string null or empty?

893


What are jagged arrays used for?

932


Can firstordefault return null?

933


What are the types of inheritance in c#?

954


Explain types of comment in c# with examples

925


Wcf and what is difference between wcf and web services?

934


Explain about multithreading?

1019


Why static constructor is parameterless in c#?

1037


What does dbml mean in texting?

920


What is JIT (just in time)? how it works?

997


In C#, explain the difference between overloading and overriding.

1125


Why are mutable structs evil?

969