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
What is xml serialization in c#?
Explain the three test cases in unit testing?
What is ildasm and obfuscator in net?
What do you know about Translate Accelerator?
What is int32 maxvalue?
What is an escape sequence?
Explain concurrency with aop?
What is static variable in c#?
What are the fundamental differences between value types and reference types?
What is instantiating a class in c#?
Explain about WSDL
What are the various components in crystal reports?
What is private protected in c#?
Is equal in c#?
What is multithreading? What are the problems that comes with multithreading and how to manage them?