Labels

slider

Recent

Navigation

Boxing and Unboxing in ASP.Net

Boxing and Unboxing in ASP.Net, boxing and unboxing in c#, boxing and unboxing terminology advantages and disadvantages


Introduction

In this example, explaining in detail difference between Boxing and Unboxing in ASP.Net. Boxing is the process of converting value type to object type and unboxing is reverse process of object type to value type. I have illustrated the concept as given below:

Boxing Unboxing in C#

Boxing

Int i;
I=78;
Object o = i;   (Boxing)

Unboxing

Int i;
Object o;
o = 8;
i = (int)o; (Unboxing)

Summary

Box and Unboxing is unified view which indicates that value type can be treated as an object. Boxing is implicit, unboxing is explicit. You see here how Boxing and Unboxing in ASP.Net is explained in detail.

Relevant Reading:

Share

Anjan kant

Outstanding journey in Microsoft Technologies (ASP.Net, C#, SQL Programming, WPF, Silverlight, WCF etc.), client side technologies AngularJS, KnockoutJS, Javascript, Ajax Calls, Json and Hybrid apps etc. I love to devote free time in writing, blogging, social networking and adventurous life

Post A Comment:

3 comments: