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 is the transport protocol you use to call a seb service soap?
What's a windows process in .net?
One user deleted one row after that another user through his dataset was trying to update same row. What will happen? How will you avoid this problem?
How you apply a theme in whole application in .Net?
How is meant by dll in .net?
What is marshling?
What is the Difference between directcast and ctype?
What is garbage collection and how it works ?
Who is using .net core?
C++ & C# differences ?
What is the new three features of COM+ services, which are not there in COM (MTS)
can we use private assembly in other project in dot net.