Monday, June 28, 2010

Difference between Value and Reference DataTypes

##Value Types

Simple variables in a class
Memory allocated on the stack
Primitive data types such as int, interface, event, and delegate.
Their existence is till they are called in a class
System.Valuetype

##Ref types
Needs to be instantiated using a 'new' keyword.
Memory allocated on the heap.
Reference types are data types such as class, char, and float.
They exist for a long period of time.
System.Object

0 comments:

Post a Comment