What is boxing and unboxing?

boxing and unboxing

Boxing: Converting a value type to object.

Unboxing: Extracting the value type from object.

 

object obj = 10; // Boxing 
int x = (int)obj; // Unboxing

 

Real-life: Data serialization processes.


Mohammad Zubair

I'm Mohammad Zubair, a passionate software engineer working in the dynamic world of IT. Currently, I'm proud to be a part of HawarIT, a thriving Dutch-Bangladeshi joint venture company, where I contribute my expertise and enthusiasm to the field of software engineering.

Leave a Reply

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