
What are Value Types in .NET?Each variable
you use in your .NET program will be of a specific type. Most commonly
used type in .NET is the value types. Here is an
example demonstrating usage of few value types and performing operations
between value types: Value types
are similar to primitive types in other languages. But there is an interesting
feature in .NET that differentiates it from others. In .NET, value types
are also inherited from System.Object. Hence they also have the characteristics
of Object. Here is an example to demonstrate that: The toString()
method belongs to an Object. But it works fine with value types. This
is because value types are also inherited from objects. However value
types are primitive in nature thereby avoiding the performance overhead
in objects. Any time, value types can be assigned to and from objects
by performing boxing and unboxing respectively.
_______________________________________________________________________
FREE
Subscription
Subscribe
to our mailing list and receive new articles Note
: We never rent, trade, or sell my email lists to Visit
.NET Programming Tutorial Homepage ______________________________________________________ |