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 a metadata in .net?
Explain the garbage collection process?
Which is the main Difference Between .Net 2003 and .Net 2005?
How will you load dynamic assembly? How will create assemblies at run time?
0 Answers InfoAxon Technologies,
How do I spawn a thread?
Where does the dispose method lie and how can it be used to clean up resources?
How to create properties and methods using controls?
differance between checkbox and rediobutton in vb.net?
What is CLR? How it will work?
Write the .net syntax for 'for loop'?
Explain what is a delegate?
DateTime[] dt = new DateTime[10] for(i=0; i<10; i++) { dt[i] = DateTime(2008, 1, i+1) } How many heap object will be created for the above array. Choose the correct answer below. Ans: 1, 10, 11, 12