c# .net Adsense ADO.NET Linq Viruses/security asp.net MVC JQuery Angular-js Node-js SEO Java C++ SQL API Networking vb.net .Net Css JavaScript Generics c#.Net entity framework HTML Website host Website Construction Guide HTTP tutorial W3C tutorial Web Services JSON Psychology Ionic framework Angular ReactJS Python Computer Android
.Net

What is concept of Boxing and Unboxing?

| | ASP , ASP-NET , CSharp

Boxing permits any value type to be implicitly converted to type object or to any interface type implemented by value type. Boxing is a process in which object instances are created and copy values in to that instance. 

Unboxing is vice versa of boxing operation where the value is copied from the instance in to appropriate storage location. 

Below is sample code of boxing and unboxing where integer data type is converted in to object and then vice versa.  

Dim x As Integer

Dim y As Object

x = 10

' boxingprocess

y = x

'unboxing process

x = y