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 is the difference between "using system.data;" and directly adding the reference from "add references dialog box"?

1064


Which file is taken by compiler when we have both file Application and Server Configuration file?

2058


Explain different types of html, web and server controls.

950


Explain About GDI object ?

1003


What is common type system (cts)?

937


Explain what is the difference between a class and an object?

1166


What is the use of design pattern?

963


What is static constructor, when it will be fired? And what is its use?

1023


What is a variable of implicit type and what is its scope?

874


Tell us the difference between managed and unmanaged code?

954


I was working for software company frm 2005 to 2009. I left job due to recession.I was jobless till dec 09 then i got job in bpo and i am not knowing what to do as my professional experience is with software.give me any suggestion.

1879


Usually in .net, the clr takes care of memory management. Is there any need for a programmer to explicitly release memory and resources? If yes, why and how?

1048


Differences between namespace, class, assembly?

975


What is the difference between response.redirect & server.transfer?

1053


Write a program to create a user control with name and surname as data members and login as method and also the code to call it.

886