Is string reference type / value type ?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is xml serialization in c#?

472


Explain the three test cases in unit testing?

594


What is ildasm and obfuscator in net?

546


What do you know about Translate Accelerator?

592


What is int32 maxvalue?

516






What is an escape sequence?

516


Explain concurrency with aop?

523


What is static variable in c#?

498


What are the fundamental differences between value types and reference types?

552


What is instantiating a class in c#?

484


Explain about WSDL

598


What are the various components in crystal reports?

504


What is private protected in c#?

502


Is equal in c#?

510


What is multithreading? What are the problems that comes with multithreading and how to manage them?

553