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 |
Explain me what is encapsulation?
Tell us what is the native image generator?
how to connect database connectivity in dotNET? if suppose SQL server?and also MS access?
i have 2 functions, int add(int a,int b); double add(int a,int b); does this code implement overloading? if not what will be the error?
Explain the difference between managed and unmanaged code?
Is there any thread in our .net programs?
diff between forms authentication and windows authentication?
Explain webfarm vs webgardens in .net?
What is RPC? What is the use of it?
What is Global Assembly Cache (GAC) and what is the purpose of it?
What is garbage collection and how it works ?
what is the difference between class and structures?