---
title: "Explain the boxing and unboxing concept in .Net?"  
description: "Explain the boxing and unboxing concept in .Net?"  
author: "Tarun Gautam"  
published: 2017-11-15  
canonical: https://answers.mindstick.com/qa/30680/explain-the-boxing-and-unboxing-concept-in-dot-net  
category: "programming"  
reading_time: 1 minute  

---

# Explain the boxing and unboxing concept in .Net?

[Explain](https://answers.mindstick.com/qa/33494/how-do-you-find-any-view-element-into-your-program-explain-for-example) the [boxing and unboxing](https://www.mindstick.com/interview/23216/difference-between-boxing-and-unboxing) [concept](https://www.mindstick.com/forum/20/dot-net-framework-concept) in .Net?

## Answers

### Answer by Arti Mishra

## “[Boxing](https://www.mindstick.com/articles/33/value-type-and-boxing) and Unboxing concept in .NET”

In a .NET programming language, **convert the value type to reference type is called boxing concept**. But the **unboxing concept is just opposite to the boxing concept**, it **converts the reference type to its value type**. The main difference between boxing and unboxing concept is, **boxing concept convert the value explicit** but **unboxing concept converts the reference type to implicit.**

![Explain the boxing and unboxing concept in .Net?](https://answers.mindstick.com/questionanswer/bd4512c2-c39b-4173-9ab3-6ab5a7ef5306/images/95658a51-200b-4dac-b7ca-2d8b22a6bb01.jpg)**\****\****For Example:** class Test{ static void Main() { int i = 5; object obj = i; // **boxing** int j = (int) obj; // **unboxing**Console.WriteLine(“Boxing Value : ”+i);Console.WriteLine(“Unboxing Value : ”+j); }} \


---

Original Source: https://answers.mindstick.com/qa/30680/explain-the-boxing-and-unboxing-concept-in-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
