Answer Posted / 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 |
Post New Answer View All Answers
What is the difference between "using system.data;" and directly adding the reference from "add references dialog box"?
Which file is taken by compiler when we have both file Application and Server Configuration file?
Explain different types of html, web and server controls.
Explain About GDI object ?
What is common type system (cts)?
Explain what is the difference between a class and an object?
What is the use of design pattern?
What is static constructor, when it will be fired? And what is its use?
What is a variable of implicit type and what is its scope?
Tell us the difference between managed and unmanaged code?
I was working for software company frm 2005 to 2009. I left job due to recession.I was jobless till dec 09 then i got job in bpo and i am not knowing what to do as my professional experience is with software.give me any suggestion.
Usually in .net, the clr takes care of memory management. Is there any need for a programmer to explicitly release memory and resources? If yes, why and how?
Differences between namespace, class, assembly?
What is the difference between response.redirect & server.transfer?
Write a program to create a user control with name and surname as data members and login as method and also the code to call it.