Question:Define Boxing and Unboxing. 

Answer Boxing:Boxing is the process of converting a value type to the object type or to any interface type implemented by this value type. When the CLR boxes a value type, it wraps the value inside a System.Object and stores it on the managed heap. Unboxing: Unboxing extracts the value type from the object. Boxing is implicit; unboxing is explicit. The concept of boxing and unboxing underlies the C# unified view of the type system in which a value of any type can be treated as an object. 

+ Report
Total Preview: 928
Define Boxing and Unboxing.
Copyright © 2024. Powered by Intellect Software Ltd