ASP.NET Questions.

Difference between value types and reference types?

* Value Types are stored on the stack where as reference types
are stored on the heap.
* Variables of the value types directly contain their data,
where as 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 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.
* Value types include simple types (e.g., char, int, and float),
enum types,and struct types.
* Reference types include class types, interface types, delegate
types,and array types.
* Converting value types to reference types is called Boxing.
* Converting reference types to value types is called Unboxing.
* Value Types which include simple types (e.g., char, int, and
float),enum types, and struct types.
* Reference Types which class types,interface types, delegate
types, and array types.

No comments: