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
How we can achieve Connection pooling in .Net?
Tell us what is a variable of implicit type and what is its scope?
What's a windows process in .net?
Do you know what is lambda expressions in c#?
How will you make .NET programs work in Linux ?
What is the use of Treeview control?
What is Finalizer in .NET define Dispose and Finalize ?
What is the advantage of packaging over xcopy in .net?
When should I use .net core?
How to implement CAS in .Net?
How is .net able to support multiple languages?
How many types of transactions are there in com + .net ?
What are the new thee features of com+ services, which are not there in com (mts)?
What is the difference between server.transfer and response.redirect? Why?