.Net Framework Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 1812 Page Views: 

Is string a value type or a reference type?



Posted By: Avi Date: 22 August 2009 07:32:08 AM
 Answer:

String is a refrence type. Value types differ from reference types in that variables of the value types directly contain their data, whereas variables of the reference types store references to objects. With reference types, it is possible for two variables to reference the same object, and thus possible for operations on one variable to affect the object referenced by the other variable. With value types, the variables each have their own copy of the data, and it is not possible for operations on one to affect the other.


Posted By: eTechPlanet


Date: 22 August 2009 07:32:08 AM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image YkTiXI
Related Questions
.Net Framework : Can we prevent a class from being inherited by another class in C#?

Can we prevent a class from being inherited by another class in C#?

Yes. The keyword "sealed" is used to prevent a class from being inherited.
Category: .Net Framework Date: 8/28/2009 6:48:43 AM
.Net Framework : What is the syntax to inherit from a class in C#?

What is the syntax to inherit from a class in C#?

Place a colon and then the name of the base class. For Example: class ChildClass : BaseClass { }
Category: .Net Framework Date: 8/28/2009 6:47:02 AM
.Net Framework : Does C# support multiple-inheritance?

Does C# support multiple-inheritance?

No
Category: .Net Framework Date: 8/28/2009 6:45:21 AM
.Net Framework : What is reflection in .Net?

What is reflection in .Net?

Discovering class information at runtime.
Category: .Net Framework Date: 8/25/2009 9:46:41 PM
.Net Framework : For what purpose Boxing is used in .Net?

For what purpose Boxing is used in .Net?

Boxing is used to convert value type to reference type
Category: .Net Framework Date: 8/25/2009 9:39:47 PM