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 can be done with c#?
What are the Configuration files in .net?
Can datetime be null c#?
What is cosole application?
Why is dll used?
Hello! How to do this: "Create manifest utility intended for creating update content files. Application should take a set of files as input parameter and generate XML based manifest file as output one." I use C# and vs.net 2003. It's urgent! Help please, thanks. Mayana
Why singleton pattern is used in c#?
What do you mean by winforms in c#?
What is using in c#?
What is boxing and unboxing in c#?
What are the collection types can be used in c#?
Can you declare a class or a struct as constant?
how background thread access to ui control?
What is a function c#?
Why can't we use a static class instead of singleton?