.Net - Difference between value types and reference
types - June 03, 2009 at 11:00 AM by Shuchi Gauri
Difference between value types and reference types
Value Type:
a. Stores the data.
b. The value of value types is stored on the managed stack.
c. One variable can have just one value.
d. They are lighter objects.
Reference Type:
a. Stores the reference to the data.
b. A reference type is allocated on the heap.
c. several variables can reference the same data
d. They are heavier objects.
Also read
What are circular references?
Explain how garbage collection deals with circular references.
A circular reference is a run-around wherein the 2 or more resources are
interdependent on each other rendering the entire chain of references to be
unusable................
Structure being value type, the variables cannot be assigned to NULL. On the
other hand, classes being reference type, a class variable can be assigned to
NULL.................
The .NET Framework class library is a library of classes, interfaces, and value
types................
A user-defined type is a named data type created by the user. It can be a
distinct type sharing a common representation with some built-in data type or
it can be a structured type which has a sequence of named attributes that each
has a type................
System.data contains basic objects. These objects are used for accessing and
storing relational data. Each of these is independent of the type of data
source and the way we connect to it.............
|