- Allocated on the stack.
- Value type variables are local copies.
- Value types are deived from System.ValueType
- Values types are always sealed and cannot be extended.
- Variables are passed by value( copy of the variable is passed into the called function )
- Value types are never placed onto the heap and therefore do not need to be finalized.
- The variable of this type die when they fall out of the defining scope.
- Allocated on the managed heap
- Reference type variables are pointing to the memory occupied by the allocated instance
- Variables are passed by reference( address of the variable is passed to the called function )
- The variable of this type die when they are garbage collected.
Value types can never be assigned the value of null.
the ? suffix notation is a shorthand for creating an instance of the generic System.Nullable
?? operator allows o assign a value to a nullable type if the retrieved value is in fact null.
No comments:
Post a Comment