C#
  Home arrow C# arrow Page 4 - C# Simplified
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
C#

C# Simplified
By: Anand Narayanaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 10
    2005-03-01

    Table of Contents:
  • C# Simplified
  • Different Types of Data Types
  • Value Types and Reference Types
  • Boxing and Unboxing
  • Classes

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    C# Simplified - Boxing and Unboxing


    (Page 4 of 5 )

    Boxing is the conversion of a value type into a reference type. Consider the listing given below:

    Listing 1.5

    // Value type X defined
    int X = 600;

    // X boxed to a object type which is reference based
    object Y = X;

    On the other hand, Unboxing is the conversion of a reference type into a value type. In listing 1.6, Y can be unboxed to a value type as shown below:

    Listing 1.6

    // Y unboxed to an integer type
    int Z = (int)Y

    The only difference is that an explicit cast is required while converting a reference type into a value type as shown above.

    More C# Articles
    More By Anand Narayanaswamy


       · This is a good beginning. It is simple enogh for a newbie. Perhaps it should be...
     

    C# ARTICLES

    - C# and XML
    - Pointers and Arrays in C#
    - C# 3.0 Extension Methods
    - Overloading Operators in C#
    - Iterators and Nullable Types
    - Patterns and Iterators in C#
    - C# Exceptions
    - Methods in C#
    - Delegates and Events in C#
    - Advanced C#
    - Working with Regular Expressions in C#
    - Sending Simple E-Mail in C#
    - Building C# Comparable Objects: IComparable ...
    - Color Transformation Applications in C# GDI+...
    - Performing Color Transformation Operations i...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT