Is string reference type / value type ?

Answers were Sorted based on User's Feedback



Is string reference type / value type ?..

Answer / vijay

String is a reference type

Is This Answer Correct ?    16 Yes 0 No

Is string reference type / value type ?..

Answer / ankur sehgal

string is reference type but it behaves as value
type.Because every time u assign a value to string a new
object is created.

Is This Answer Correct ?    8 Yes 0 No

Is string reference type / value type ?..

Answer / vakil vijay vamangari

String is reference type .

Is This Answer Correct ?    7 Yes 0 No

Is string reference type / value type ?..

Answer / vinay tiwari

//string is a refference type but it behavious like a value
//type.
//following programe show both charactersitic of string.
using System;
class a
{
public static void Main(String [] args)
{
String str1="hello";
String str2=str1;
String str3="hello";
Console.WriteLine(str1);
Console.WriteLine(str2);
if(str1==str3)
{
Console.WriteLine("str1 anb str3 are
equal ");
}
}
}

Is This Answer Correct ?    3 Yes 1 No

Is string reference type / value type ?..

Answer / avisek

string is referrence type....
bcz there is no limitations of string means it can have variable length......thats why str[0],str[1],
string stores only the referrence to the value stored in it....

Is This Answer Correct ?    2 Yes 0 No

Is string reference type / value type ?..

Answer / narayansahu

It's a common misconception that string is a value type.
That's because its immutability makes it act sort of like
a value type. It actually acts like a normal reference type

Is This Answer Correct ?    3 Yes 2 No

Is string reference type / value type ?..

Answer / deepak sharma

string is both type it depends on use

Is This Answer Correct ?    0 Yes 9 No

Post New Answer

More C Sharp Interview Questions

What is inheritance in csharp?

0 Answers  


How can we sort the elements of the array in descending order?

0 Answers  


What is parsing?

0 Answers  


What I can do with c#?

0 Answers  


Explain the use of SN.exe

0 Answers   Accenture,






What is session state in asp net c# with example?

0 Answers  


Name the control which cannot be placed in mdi?

0 Answers  


1. What is lazy loading? 2. What is delay signing? 3. How to transfer view object to presenter in MVP? 4. How to create a generic class? 5. What is Ajax object? 6. What is explicit interface implementation? 7. I1, I2 interfaces have same methods (say PrintName) explicitly implemented in class C1. Now how to call PrintName method from I1? 8. I have a list of Customers. List the customer with maximum orders using LINQ.

1 Answers   Aptron, Volvo,


Explain About the Sattilite Assembly in .Net Technology?

2 Answers   TCS,


Can I use ReaderWriterLock instead of Monitor.Enter/Exit for Threading?

0 Answers   HCL,


Explain get and set accessor properties?

0 Answers  


what is the equivalent to regsvr32 and regsvr32 /u a file in .net development?

0 Answers   4Cplus,


Categories