What is boxing and unboxing ?

Answer Posted / kirti

Boxing :- Boxing is an implicit conversion of a value type to the type object type

Eg:-

Consider the following declaration of a value-type variable:

int i = 123;

object o = (object) i;

Boxing Conversion

UnBoxing :- Unboxing is an explicit conversion from the type object to a value type

Eg:

int i = 123; // A value type

object box = i; // Boxing

int j = (int)box; // Unboxing

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the channels in .net remoting?

718


What are different types of assemblies?

772


What is the proxy of the server object in .net remoting?

763


What are the ways to renew lifetime leases of objects?

784


Explain the difference between the registerwellknownservicetype(), registerwellknownclienttype(), registeractivatedservicetype() and registeractivatedclienttype() in .net?

709


Which one is better WebService and Remoting ?

808


Can you explain remoting?

777


Hello, I want to connect a system in LAN and i want to access that.When ever i am moving a mouse in my desktop the similar thing have to happend in the another system in which i have connected. I need coding for this in c# and .NET . any one please help me.It is very urgent to me Advance thanks. my email id:manojkumarchallagundla@gmail.com

2496


Explain the Flow of remoting?

772


Garbage collector?s functionality on unmanaged code ?

3282


What are the threading types?

731


Explain the hierarchial description of remoting?

702


Explain the differences between marshal by value and marshal by reference?

788


Define a process?

718


Elaborate the term WebService and how it differ from Remoting?

735