Blue Theme Orange Theme Green Theme Red Theme
 
Home | Forums | Videos | Photos | Downloads | Blogs | E-Books | Interviews | Jobs | Beginners | Training
 | Consulting  
Submit an Article Submit a Blog 
Search :       Advanced Search »
Home » Blogs Home » Blog Detail
Boxing and Unboxing in C#
 by Purushottam Rathore on Nov 04, 2009

Boxing and Unboxing in C#
Comments: 0 Views: 381     Printable Version

Boxing: The process of converting from a value type to a reference type is called boxing. Boxing is an implicit conversion.
Boxing example:
using System;
class ConversionSamp
{
    static void Main()
    {
        int a = 5;
        Object obj = a;
        Console.WriteLine(a.ToString());
        Console.WriteLine(obj.ToString());
    }
}
Unboxing: The process of converting from a reference type to a value type is called unboxing.
Unboxing example:
using System;
class ConversionSamp
{
    static void Main()
    {
        Object obj = 5;
        int a = (int)obj;
        Console.WriteLine(a.ToString());
        Console.WriteLine(obj.ToString());
    }
}
 
*Title:  
*Comment:
 
 
No record available

 Blogger's Profile
Age: Not Available
Location:
Title: Developer
Joined: Apr 19, 2007
Education: Not Available
 More Blogs from this Blogger
Boxing and Unboxing in C#
Stored Procedures vs parameterized queries
Stored Procedures Related to Table in Database
Enter only letters(caps and small both) as input in to text box.
Most popular video formats
Global.asax
Garbage Collection
View all »
 Latest Blogs
RadEditor in asp.net using Telerik Controls Dll
deleting the duplicate records from SQL Server table
how can i change Text to Graphics
play flash files in windows forms using c#
convert the database table into xml
Autocomplete Textbox im asp.net
SQL Server 2008 installation problem
pictures
Visual Studio 2010 - Installation Problems Discuss
Reporting Services Catalog Error
View all »
 Latest Articles
Pie Chart in WPF
Creating a Line Chart Application in GDI+
DOM Overview
Control Statements in C#
Cursors in Silverlight 3
Hyperlink Text Wrap In Silverlight 3
Literal Control in ASP.NET
Bar Chart in WPF
An XML Document and its Items
Drawing Ellipses and Circles in GDI+
View all »

 Hosted by MaximumASP  |  Found a broken link?  |  Contact Us  |  Terms & conditions  |  Privacy Policy  |  Site Map  |  Suggest an Idea  |  Media Kit
Current Version: 5.2009.6.2
 © 1999 - 2009  Mindcracker LLC. All Rights Reserved