Is string a value type or a reference type?
Answers were Sorted based on User's Feedback
Answer / 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 |
Using activex control in .net?
How Garbage Collector (GC) Works?
Explain what is an interface and what is an abstract class? Please, expand by examples of using both. Explain why?
What is a formatter in .net?
Is there any attempt system for microsoft technology papers?
How to debug failed assembly binds?
What do you mean by Code Access Security in .NET?
Differences between datagrid, datalist and repeater in .net?
Explain about .Net products?
Please explain what is heap and what is stack?
What is heap and what is stack?
Is .net a language?