Answers

Question and Answer:

  Home  Senior .Net Developer

⟩ What is the difference between boxing and unboxing?

Boxing 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

 144 views

More Questions for you: