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
What are an object and a class?
What is an exe and a dll?
Differentiate between managed and unmanaged code?
Explain what rare the types of jit and what is econo-jit?
What is reflection in microsoft .net context?
What is Event Bubbling in .NET?
Explain the difference between garbage collections in .net 4.0 and earlier versions?
Is .net core the future?
Is .net capable of supporting multi-thread?
Explain the difference between public and static modifiers?
Explain how to spawn a thread?
Explain .net framework overview?
Explain something about WebService?
Tell us what is a sealed class?
How do you turn off cookies for one page in your site? Give an example.