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
Is array a list?
How many types of collections are there in c#?
What are the differences between system.string and system.text.stringbuilder classes?
What is use of FormBoarderStyle Propertie
Can we write class inside a class in c#?
What is mvc firstordefault?
How does the clr work?
What is Assembly. and Describe type of assembly. why most developer happy with private assembly.
What is int64 in c#?
What is tuple in c#?
Can we call server-side code (c# or vb.net code) from javascript?
Can abstract class have private constructor c#?
What's new in c#?
How do I create a single-file assembly?
Explain about multithreading?