Difference between boxing and unboxing in C#
Loading
Difference between boxing and unboxing in C#
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rajanikant HawaldarPosted Oct 31, 2022, 8:47 AM
Object type refers to the value type, process of retrieving value from the boxed object.
The value stored on the stack is copied to the object stored on heap memory,The object's value stored on the heap memory is copied to the value type stored on stack.
Implicit conversion,Explicit conversion.
Boxing Example:
Unboxing Example:
Jignesh KumarPosted Oct 31, 2022, 7:05 AM
Boxing is process of converting value type variable to reference type varaiable or object.
i.e.
Unboxing revers of boxing. It means converting Referecen type varialbe to value type.
i.e.