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

Please explain what is the .net framework and how does it work?

0 Answers  


What is strong-typing versus weak-typing? Which is preferred?

0 Answers  


Differentiate between managed and unmanaged code?

0 Answers  


What is multiThreading in .NET?

0 Answers  


Is .net is a language?

0 Answers  


How com+ related to the dna architecture?

0 Answers  


What are remotable objects in .NET Remoting?

1 Answers  


What does the "EnableViewState" property do?

1 Answers  


What is typical about a windows process in regards to memory allocation in .net?

0 Answers  


How to convert a .NET object into COM operabililty?

0 Answers   Petranics Solutions,


Is there built-in support for logging?

0 Answers  


How viewstate is being formed and how it is stored on client in .net?

0 Answers  


Categories