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

What is a delegate, What is a delegate? A delegate is similar to a clas...

What is a delegate? A delegate is similar to a class that is used for storing the reference to a method and invoking that method at runtime, as needed. A delegate can hold the

Cookies, #question.cookies working with data.

#question.cookies working with data.

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

Problems occur while implement locking in sql server, What are the problems...

What are the problems that can occur if you do not implement locking properly in SQL SERVER? The problems that occur if you do not implement locking properly in SQL SERVER is a

Develop a windows desktop application, Develop a windows desktop applicatio...

Develop a windows desktop application Project Description: I am looking to get a desktop application developed. The desktop application will have the subsequent few features:

Elements in functions points, What are the different elements in Functions ...

What are the different elements in Functions points? 1) Internal Logical Files (ILF): Following are some points to be noted for ILF:- The ILF are logically related d

Calculate and display the volume of the sphere, Question: (a) Define f...

Question: (a) Define four special target names use with the TARGET attribute. (b) Assume that you have a document with many subsections. Write the HTML code to create a fr

Function points, What are function points? The FPA is breaking huge sys...

What are function points? The FPA is breaking huge systems into smaller pieces and analyzing them. The Software application is a combination of set of elementary processes. The

I need a custom report - crystal reports, I need a Custom Report - Crystal ...

I need a Custom Report - Crystal Reports Project Description: I am seeking a custom report for our syrinx hire software, all reports are made from Crystal Reports. Skills

Deployment diagram, Explain all parts of a deployment diagram. Pa...

Explain all parts of a deployment diagram. Package: - The package logically groups element of a UML model. Node: - The Node is as physical system which represents a

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