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 |
What do you mean by web service?
How to instantiate a delegate?
What are the differences in C# .Net and ASP .Net.
How do you create threading in.net?
Explain the difference between asp.net & vb.net and explain architecture?
What is Atomicity?
How will you load an assembly which is not referenced by current assembly?
What is the difference between function and stored procedure?
Is there any attempt system for microsoft technology papers?
What is the difference between boxing and unboxing?
How do we access crystal reports in .net?
Please explain what is the difference between odbc and ado?