Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Difference b/w casting and boxing?

Answers were Sorted based on User's Feedback



Difference b/w casting and boxing?..

Answer / linton lazar

Boxing is converting a value type to a reference type
(Object Type).Casting is converting a reference type to a
reference type or a value type as another value type.
int i = 0;
object o = (object)i; //this is boxing
int i2 = (int)o; //this is unboxing.

long l = (long)i; //this is casting.

Is This Answer Correct ?    22 Yes 0 No

Difference b/w casting and boxing?..

Answer / anil kumar

Boxing is Converting to a value type to refrence type and
casting mean convert value type to a another value type.

int a;
object o=(object)a;(Boxing)

int a;
long b=a;(casting)

Is This Answer Correct ?    2 Yes 1 No

Difference b/w casting and boxing?..

Answer / kinjal panchal

Boxing:- Boxing is converting value type to Reference type.
for Example:-

int i=0;
object O=(object)i;

Casting:- Casting is converting value type to another value type
for example:-

int i=0;
long l=(long)i;

Is This Answer Correct ?    1 Yes 0 No

Difference b/w casting and boxing?..

Answer / anand gopal makwa munger

Boxing is the term for turning a value type (int, double, float, Guid, etc.) into a reference type (System.Object, System.String, etc.). Doing this boxing operation allocates memory on the heap (which the garbage collector will eventually need to reclaim).

Casting is taking a type (say, System.Object) and treating it as another type (say, System.String).

Is This Answer Correct ?    0 Yes 0 No

Difference b/w casting and boxing?..

Answer / sridevipc

casting converts value to reference type
boxing converts reference type to value type.



Is This Answer Correct ?    2 Yes 24 No

Post New Answer

More ASP.NET Interview Questions

What does session_start () do?

0 Answers  


How to Insert a TextBox value in to Sql database using C# coding?

17 Answers   HCL, Sona, TCS,


What is SOAP, UDDI and WSDL ?

2 Answers   Infosys, Network, TCS, Wipro,


What are the types of assemblies and where can u store them and how ?

1 Answers   Patni,


What is the difference between a thread and a process?

3 Answers  


What is bound controls

0 Answers   MCN Solutions,


What is synchronous and Asynchronous post back ?

0 Answers  


How can you pass multiple complex types in Web API?

0 Answers  


Explain how server control validation controls works?

2 Answers   CMS, Syntax Softtech,


Name two properties common in every validation control?

9 Answers   Siebel Systems,


Explain the asp.net page life cycle.

0 Answers  


What is session handling in a webfarm, how it can work with its limits?

0 Answers   Siebel,


Categories