Congratulations to all monthly winners of May 2013 !!! They have won INR 2900 cash and INR 27497 worth prize.
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 16675 |  Welcome, Guest!   Register  Login
 Home > Blogs > C# > Simple Way to define Boxing and UnBoxing? ...
Sourabh07

Simple Way to define Boxing and UnBoxing?

 Blog author: Sourabh07 | Posted on: 10/29/2012 | Category: C# Blogs | Views: 427 | Status: [Member] | Points: 75 | Alert Moderator   
Ads

Boxing:

   1) Converting the value type to the object type ( means to say it gets the value from the value type and stores it in the managed heap.

   2) is Implicit

eg:

int i = 77;
object obj = i;  /* It can simply assign to the type object in boixing and in technical term it boxes i */

UnBoxing:

   1) Converting the value from the object type to the value type (extracting the value and assigned to the value type)

   2) is Explicit

eg:

object obj = 70;
int i = (int) obj; /* unboxing the value wrapped inside the object type obj */



Sourabh07
Found interesting? Add this to:


About Sourabh 07

Experience:1 year(s)
Home page:http://www.dotnetfunda.com
Member since:Saturday, October 13, 2012
Level:Starter
Status: [Member]
Biography:Dot Net Developer

 Responses

Chiragkanzariya
Posted by: Chiragkanzariya | Posted on: 11/6/2012 | Level: Starter | Status: [Member] | Points: 15 | Alert Moderator 

Simple and Effective Code..
good Job.

Check My Blog http://chiragkanzariya.blogspot.in

>> Write Response - Respond to this post and get points

More Blogs

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 6/19/2013 7:27:23 PM