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
Explain Creational design pattern in .NET?
What is the concept of inheritance and how it works in .net?
what is the keyword used for self reference?
What is a windows process in .net?
Is there any attempt system for microsoft technology papers?
Differentiate between managed and unmanaged code?
Explain what is mutex?
How to create a key pair in .net?
What is common type system (cts)?
Elements of CAS
Please explain what are an object and a class?
Explain the difference between the stack and the heap?
What are pdbs?
Will my .net app run on 64-bit windows?
Do you know what is linq?