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 a value type or a reference type?

Answer Posted / rajneesh hajela

string is immutable

but stringbuildler are mutable...

this play many role


StringBuilder y = new StringBuilder();
y.Append("hello");

StringBuilder x = new StringBuilder();
x.Append("hello");

if (y == x)
{
}
// Stirng is immutable .In some ways it to
be value types .These are known as immutable .
//===================

string str1 = "hello";
string str2 = "hello";

if (str1 == str2)
{
}
//===============
string y1 ="";
y1="hello";

Program p = new Program();
p.foo(ref y1);
Console.WriteLine(y1);

}

void foo(ref string sb)
{
sb="Rajneesh Hajela:";
}


Rajneesh Hajela

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How we can achieve Connection pooling in .Net?

1095


Tell us what is a variable of implicit type and what is its scope?

1018


What's a windows process in .net?

1000


Do you know what is lambda expressions in c#?

1061


  • Accomm
  • i have this code.now on server side i want to compare this id(Accommodation) value and want id i.e.Accommodation.visible=true;

    1814


    How will you make .NET programs work in Linux ?

    2016


    What is the use of Treeview control?

    1113


    What is Finalizer in .NET define Dispose and Finalize ?

    1062


    What is the advantage of packaging over xcopy in .net?

    1064


    When should I use .net core?

    1098


    How to implement CAS in .Net?

    2843


    How is .net able to support multiple languages?

    1021


    How many types of transactions are there in com + .net ?

    1075


    What are the new thee features of com+ services, which are not there in com (mts)?

    992


    What is the difference between server.transfer and response.redirect? Why?

    1048