From course:
(Practice similar questions for free)
Advanced Concept C# Interview Questions
» Start this Course(Practice similar questions for free)
Question:
What are boxing and unboxing in C#?
Author: Lock HuynhAnswer:
In C#, boxing is the process of converting a value type (e.g., int, char) to an object type, essentially wrapping the value type in an object. This occurs when a value type is assigned to a variable of type object or any interface it implements. Unboxing is the reverse process, where an object is converted back to a value type. This involves explicitly casting the object back to the original value typ
0 / 5 Â (0 ratings)
1 answer(s) in total