All the types are derived from System.Object base type.
Value type - contain actual value on its memory location. Its allocated to stack.
Reference type - contains a new memory location address on its memory location. Its allocated to heap.
Changing value of a reference type can effect some other objects those are referring that reference type.
Value types ex. - All numeric types, Datetime, Boolean, Char, Structure, Enumeration.
Reference types ex. - String, Array, Delegate, Class.
* Structure and Enumeration are value types even they contain reference type members.
* String, Array are reference types even they contain value types.
Value type - contain actual value on its memory location. Its allocated to stack.
Reference type - contains a new memory location address on its memory location. Its allocated to heap.
Changing value of a reference type can effect some other objects those are referring that reference type.
Value types ex. - All numeric types, Datetime, Boolean, Char, Structure, Enumeration.
Reference types ex. - String, Array, Delegate, Class.
* Structure and Enumeration are value types even they contain reference type members.
* String, Array are reference types even they contain value types.
No comments:
Post a Comment