Demonstrating boxing and unboxing - c# program, DOT NET Programming

Assignment Help:

Demonstrating Boxing and Unboxing - C# Program

Hi,

Can any of you, tell me how to use boxing and Unboxing in c#?


Related Discussions:- Demonstrating boxing and unboxing - c# program

Sequence in which asp.net events are processed, What' is the sequence in wh...

What' is the sequence in which ASP.NET events are processed? The sequence in which the ASP.NET events occur are as folows :- 1.     Page_Init. 2.     Page_Load. 3.

Unicode, What is Unicode? In order to understand the concept of Unicode...

What is Unicode? In order to understand the concept of Unicode we require  to move a little back and understand the ANSI code. The ASCII (ask key) stands for American Standard

We need of an expert web developer, Web Developer Project Description: ...

Web Developer Project Description: We need of an expert web developer for long term association, please apply with models if you have the subsequent skills: ASP.NET MVC 3

Uddi, What is UDDI? The Full form of the UDDI is Universal Description,...

What is UDDI? The Full form of the UDDI is Universal Description, Discovery and Integration. The directory that can be used to publish and discover public Web Services. If you

Describe the xmlwriter class, Describe the XmlWriter class. The XmlWrit...

Describe the XmlWriter class. The XmlWriter class is used to write XML to a stream, a file, or a Textwriter object. This class works in a forward-only, non-cached manner. You c

Screen sharing training software like gotomeeting, Screen sharing Training ...

Screen sharing Training software like GOTOMEETING Project Description: We do have online trainings business; we are providing trainings with webex or gotomeeting at this mome

App to evaluate if a street address fits within a specified, Project Descri...

Project Description: Take a CSV of Canadian street addresses. For every address, translate the address into a GPS coordinate. Use the GPS coordinate to test whether or not the a

Dcom, What is DCOM? DCOM is different from COM in that it allows for cr...

What is DCOM? DCOM is different from COM in that it allows for creating objects distributed around  a network, and a protocol for invoking that object's methods, & secures the

Title..case statement, Design an interface and add code to command buttons ...

Design an interface and add code to command buttons using case statement, to find coursework to be calculated using formula 0.6*1/6*total Mark

Hash table, What is a Hash Table? You can access an array using the IND...

What is a Hash Table? You can access an array using the INDEX value of that array, but how many times you know the real value of the index. The Hashtable provides a way of acce

Max

2/11/2013 5:48:02 AM

You might check out this, this is useful for you

Demonstrating Boxing and Unboxing - C# Program

using System; 

class Boxing 

      public static void main(string[] a) 

       { 

            //  BOXING 

               int m = 10; 

               object om = m; // creates a box to hold m 

               m = 20; 

              Console.WriteLine("****** BOXING *****"); 

              Console.WriteLine("m = " + m); // m = 20 

              Console.WriteLine("om = " +om);// om = 10 

              Console.ReadLine(); 

            //  UNBOXING 

               int n = 10; 

               object on = n; // box n (creates a box to hold n) 

               int x = (int)on; // unbox on back to an int 

              Console.WriteLine("**** UNBOXING *****"); 

              Console.WriteLine("n = " + n); // n = 20 

              Console.WriteLine("on = " +on);// on = 10 

              Console.ReadLine(); 

          } 

}

Bella

2/11/2013 5:50:52 AM

Hey Max you are a GREAT instructor! As a C# beginner, this is the first time out of at least three previous tried?that I can finally understand what is boxing and unboxing in c#.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd