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 / djfox7200x

Strings are immutable.Hence they behave like a value type
when they are actually reference type;

eg. string objA="cat";
//cat is an immutable string in memory and objA points to
it.
string b=a; //reference is copied to b;

a="dog"; new immutable object created and a points to it;

//b is still cat since its refernce has not changed

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How long does it take to get a loop recorder put in?

850


What are the fundamental principles of oo programming?

1103


What are the types of inheritance in c#?

956


How are Windows programs different from normal C-programs?

2208


What is the max value of int32 in c#?

915


Differentiate between dataset and datareader?

959


What is exe in c#?

921


Define Abstract Class in C#

964


Can we declare private class in c#?

910


Does c# support templates?

974


How do I count the length of a string in c#?

967


What is the difference between Static, Const and read only?

1073


Can we set image Source dynamically using C# in WPF application?

1063


Why are strings immutable c#?

923


What is thread in c#?

949