Interview questions

NET Boxing and Unboxing

Next question>>
NET Boxing and Unboxing - April 1, 2009 at 17:30 PM by Rajmeet Ghai

Explain Boxing and Unboxing in .NET.

Boxing permits any value type to be implicitly converted to type object or to any interface type Implemented by value type. It is the process of allocating an object instance and copying the value type value into that instance.

E.g.
Int I =10;
A boxing conversion involves copying of the value being boxed.

Boxing permits any value type to be explicitly converted to type object or to any interface type Implemented by value type. It first checks the object instance is a boxed value of the given value-type, and then copying the value out of the instance.

E.g.
Object box = 11;
Int I = (int) box;

Next question>>



Write your comment - Share Knowledge and Experience


Also read     

Explain the concepts of CTS and CLS(Common Language Specification).

CTS define how these different variables are declared and used in run time...........

What is Manifest in .NET?

Manifest in .NET helps to understand the relation between the elements of the assemblies...........

What is garbage collection? How to force garbage collector to run?

Garbage collection helps in releasing memory occupied by objects. CLR automatically releases these unused objects...........

Explain the features of an abstract class in NET.

An Abstract class is only used for inheritance. This means it acts as a base class for its derived classes..............

What are the concepts of DISPOSE method?

Dispose method belongs to IDisposable interface. It is used to free unmanaged resources like files, network connection etc..............

 
Latest placement tests
Latest links
 
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us | We are hiring