Boxing | Unboxing | |
Definition: | Boxing is the process of converting a value type to the reference type. | Unboxing is the process of converting a reference type to value type . |
Type of Conversion: | Implicit Conversion | Explicit Conversion |
Example: | int i = 221; object obj = i; //boxing | object obj = 213; i = (int)obj ; // unboxing |
Blog that contains articles about new technologies related or not with programming. I will describe and solves some problems that I encounter in my career. ASP .NET, AJAX, Javascript, C++, C# and SQL are some of the subjects that will appear.
03 July 2014
Boxing vs UnBoxing
Boxing and Unboxing is a essential concept in .Net’s type system. With Boxing and Unboxing one can link between value-types and reference-types by allowing any value of a value-type to be converted to and from type object. The basic differences are :-
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment