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 to implement CAS in .Net?
What is clr in .net?
What are an object and a class?
Please explain what are an inheritance, polymorphism, and encapsulation?
What is typical about a windows process in regards to memory allocation in dot net?
Please explain what is the .net framework and how does it work?
Explain what is the difference between constants and read-only variables?
What is the difference between a class and an object, and how do these terms relate to each other?
What is 3 tier architecture?
Differentiate between 'DataSet' and 'SQLDataReader' in ADO.NET?
What is RCW (Run time Callable Wrappers)?
what is the default security setting in .net?
What is namespace in .net?
What is value type and refernce type in .net?
What is heap and what is stack?