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

How u refer webservices?

1496


What are session state modes? List some of the important session state modes of asp.net.

537


What is page fragment caching?

555


Give me one example of Web API Routing?

602


Explain the function of new view engine in asp.net? : asp.net mvc

526






What is the difference between session and viewstate?

520


What is fulltrust?

565


What are app services?

534


Explain the asp.net mvc request life cycle? : asp.net mvc

506


How can you make sure that web api returns json data only?

519


What is the significance of proxy user?

619


How do you identify that the page is postback?

541


Which platform does Microsoft .NET use for exchanging data between applications?

589


In Code-Behind class which kind of code (server or client) is found ?

599


What is _viewstart?

510