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 does .net stand for?
What is the Difference between a sub and a function?
What is .net latest version?
What are the deferred execution and the immediate execution in linq?
What’s different between process and application in .net?
What is the difference between .net and laravel?
What is jit compilers?
What are Sessions?
How do you define the lease of the object in .net?
What is Assembly?
What is stored procedure ? how we use it in .NET ?
Explain what is the difference between odbc and ado?