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
Explain About namespaces
Which attribute is used in order that the method can be used as webservice?
What are different types of Delegates in C#?
Can a class be private in c#?
What is datatable and dataset in c#?
Why we use oops in c#?
What does void mean in c#?
Can an abstract class inherit from another abstract class c#?
What is constants in c#?
What is the use of tuple in c#?
Can a loop recorder detect a heart attack?
What floating point types is supported in C#?
How long can loop recorders stay in?
What is returned if you pass the value 12.34 to the parsefloat () function?
Define multicast delegate? How it be used?