What is boxing?

Answer Posted / maloy.adhikari

Boxing is the process of converting a value type to the
type object 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 extracts the value type from the object. In
the following example, the integer variable i is boxed and
assigned to object o.
Exam::
int i = 123;
object o = (object)i; // boxing
...........
o = 123;
i = (int)o; // unboxing

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between debug.write and trace.write? When should each be used?

564


How can we use Web API with ASP.NET Web Form?

652


What do you mean by authorization?

529


What is caching? What are different ways of caching in asp.net?

667


What are the Types of session management in ASP.NET

566






What are custom controls?

533


explain code with multi inhertance

1653


How do I publish my asp.net application to my isp's web server?

595


What is the difference between viewstate and hidden field in asp.net?

492


How will you do windows authentication and what is the namespace? If a user is logged under integrated windows authentication mode, but he is still not able to logon, what might be the possible cause for this? In ASP.Net application how do you find the name of the logged in person under windows authentication?

556


Explain diff between dataset and datareader?

533


What is httpresponse?

518


Which browsers support the xmlhttprequest object?

524


What are the asp.net security controls?

560


Explain automatic memory management in .net.

594