What is the difference between boxing and unboxing?
Submitted by: MuhammadBoxing is the process of converting a value type to the type object, and unboxing is extracting the value type from the object. While the boxing is implicit, unboxing is explicit.
Example (written in C#):
int i = 13;
object myObject = i; // boxing
i = (int)myObject; // unboxing
Submitted by: Muhammad
Example (written in C#):
int i = 13;
object myObject = i; // boxing
i = (int)myObject; // unboxing
Submitted by: Muhammad
Read Online Senior .Net Developer Job Interview Questions And Answers
Top Senior .Net Developer Questions
☺ | Explain me how does LINQ work? |
☺ | Explain me what is encapsulation? |
☺ | Tell us what is Heap and what is Stack? |
☺ | Explain what is Mutex? |
☺ | Please explain when should you use .NET Web Forms over ASP.NET MVC? |
Top Dot Net Technologies Categories
☺ | MSF Interview Questions. |
☺ | .Net Architecture Interview Questions. |
☺ | ASP.Net MVC Interview Questions. |
☺ | Entity Framework Interview Questions. |
☺ | C# (Sharp) Programming Language Interview Questions. |