Best Industrial Training in C,C++,PHP,Dot Net,Java in Jalandhar

Sunday, 25 December 2011

Data Types in .Net

Value Types
Reference Types
allocated on stack
allocated on heap
a value type variable contains the data itself
reference type variable contains the address of memory location where data is actually stored.
when you copy a value type variable to another one, the actual data is copied and each variable can be independently manipulated.
when copying a reference type variable to another variable, only the memory address is copied. Both variables will still point to the same memory location, which means, if you change one variable, the value will be changed for the other variable too.
integer, float, boolean, double,struct etc are value types.
string and object,class are reference types.

No comments:

Post a Comment