What is Value Types versus Reference Types?

 Posted by Tripati_tutu on 2/19/2011 | Category: C# Interview questions | Views: 5028 | Points: 40

The Value Types which includes most built-in types such as numeric types, char types and bool types as well as the custom struct and enum types. The content of a Value Type variable is simply a value.

But in case of Reference Types, it includes all classes, array, interface, and delegate types. This is quite different from value type. It contains two parts that is an object and the reference to that object. The content of this type is a reference to an object that contains a value.

The basic difference between them is, how they are handled inside the memory.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response