Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Is string reference type / value type?

Answer Posted / mathew

I am confused,
Microsoft in one site says "String is a reference type".
Check the below website
http://msdn.microsoft.com/en-us/library/362314fe.aspx
It says
"Although string is a Reference type, the equality
operators (== and !=) are defined to compare the values of
string objects, not references. This makes testing for
string equality more intuitive".

while when checked the other website
http://msdn.microsoft.com/en-us/library/83fhsxwc.aspx
Which list's "Built-In Types Table (C# Reference)" which has
STRING in the list

C# Type .NET Framework Type
--------- ---------------------
bool System.Boolean
byte System.Byte
sbyte System.SByte
char System.Char
decimal System.Decimal
double System.Double
float System.Single
int System.Int32
uint System.UInt32
long System.Int64
ulong System.UInt64
object System.Object
short System.Int16
ushort System.UInt16
string System.String

And it is mentioned
"All of the types in the table, except OBJECT and STRING,
are referred to as simple types."

From all these I infer that "STRING is a reference type".

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a struct inherit from another struct or class in c#?

873


What are the different types of delegates?

891


What is the use of return in c#?

900


Why do I get an error (cs1006) when trying to declare a method without specifying a return type?

904


What is the purpose of static?

945


How do I make a dll in c#?

891


How will you allow a class to be inherited, but prevent the method from being over-ridden?

952


What is parameterized constructor?

892


C# called c sharp why?

959


What is difference between destructor and finalize?

872


Can private virtual methods be overridden in c#.net?

863


What type of data type conversion happens when the compiler encounters the following code?

883


List the different stages of a thread?

849


What is class in oops with example in c#?

872


What is razor view in c#?

792