Is string a value type or a reference type?

Answers were Sorted based on User's Feedback



Is string a value type or a reference type?..

Answer / suhasini suresh

It is a reference type

Is This Answer Correct ?    4 Yes 0 No

Is string a value type or a reference type?..

Answer / prashant mishra

string is a reference type data type

Is This Answer Correct ?    2 Yes 0 No

Is string a value type or a reference type?..

Answer / indrajeet kumar

string is the reference type of data.

Is This Answer Correct ?    2 Yes 0 No

Is string a value type or a reference type?..

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

Post New Answer

More Dot Net General Interview Questions

What is the use of immutability?

0 Answers  


What is the raise event used for?

4 Answers   Wipro,


What is iis? Have you used it?

0 Answers  


Explain what are possible implementations of distributed applications in .net?

0 Answers  


Is there any thread in our .net programs?

0 Answers  






What is reflection in microsoft .net context?

0 Answers  


Tell us what do the following acronyms in .net stand for: il, cil, msil, cli and jit?

0 Answers  


What is managed code in .NET?

0 Answers  


What is DTS and explain the purpose of it?

0 Answers   ADITI,


How is meant by dll in .net?

0 Answers  


What?s Singleton activation mode?

1 Answers  


How do you trigger the paint event in system.drawing?

0 Answers  


Categories