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

Which Namespaces is used to achieve the Remoting?

576


Define singleton activation mode in .net remoting?

529


Explain marshalling and its types in .net remoting

524


What are static assemblies and dynamic assemblies. Differences between them?

643


Explain threading types?

660






What is the difference beween the registeractivatedservicetype() and registeractivatedclienttype()?

544


define client activated objects (cao)?

627


What are the consideration in deciding to use .NET Remoting or ASP.NET Web Services?

1676


What are the information required to configure remote objects?

523


Is it a good design practice to distribute the implementation to remoting client?

515


What are the security features in .net remoting?

552


Explain the types of .net remoting?

617


Explain the hierarchial description of remoting?

537


Define remotable objects in .net remoting?

564


Difference between web services & remoting?

612