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 c# int immutable?
What is this keyword in C#?
What is inline function in c#?
What is meant by generics in c#?
Do unused Namespaces in c# affect run-time performance?
Is typeof c#?
Write a program to find the angle between the hours and minutes in a clock
What is Assembly. and Describe type of assembly. why most developer happy with private assembly.
What are most desktop applications written in?
Why we use extension method in c#?
What is a decimal in c#?
Is c# difficult to learn?
Is array immutable in c#?
How do I convert a string to an int in c#?
Can a method be sealed in c#?