What is meant by Boxing and Unboxing?

The method of converting a value type into a reference type is called as BOXING

int a = 15;
string myString = a.ToString();

The conversion of a reference type into a value type is called as UNBOXING

string str = "15";
int val = int.parse(str);

The method of converting a value type into a reference type is called as BOXING

int a = 15;
string myString = a.ToString();

The conversion of a reference type into a value type is called as UNBOXING

string str = "15";
int val = int.parse(str);

Buy Me A Coffee

Found this article helpful? Please consider supporting!

Ram
Ram

I'm a full-stack developer and a software enthusiast who likes to play around with cloud and tech stack out of curiosity. You can connect with me on Medium, Twitter or LinkedIn.

Leave a Reply

Your email address will not be published. Required fields are marked *