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

What are an object and a class?

1181


What is an exe and a dll?

1253


Differentiate between managed and unmanaged code?

1207


Explain what rare the types of jit and what is econo-jit?

1131


What is reflection in microsoft .net context?

1081


What is Event Bubbling in .NET?

1165


Explain the difference between garbage collections in .net 4.0 and earlier versions?

1175


Is .net core the future?

1057


Is .net capable of supporting multi-thread?

1089


Explain the difference between public and static modifiers?

1202


Explain how to spawn a thread?

1022


Explain .net framework overview?

1115


Explain something about WebService?

1201


Tell us what is a sealed class?

1082


How do you turn off cookies for one page in your site? Give an example.

1006