SEARCH
You are in browse mode. You must login to use MEMORY

   Log in to start


From course:

Advanced Concept C# Interview Questions

» Start this Course
(Practice similar questions for free)
Question:

What are boxing and unboxing in C#?

Author: Lock Huynh



Answer:

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