Differance between Value Type and Referance Type

Value Type:

1) Stored in stack.
2) Access directly.
3) Life time determine by lifetime of variable that contain them.
4) e.g. All numeric data type, Boolean, char, Date, Structure, enumerations.

Reference Type:

1) Stored in heap.
2) Access through references.
3) Lifetime is managed by .net framework.
4) e.g. All arrays, String, Class types, Delegate.

Note: Object is not any kind of type. You can create object of structure as well as Class

Are not type: Namespaces, Modules, Events, properties, procedures, variables, constants ,& fields.

0 comments: