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

.net components in com, How can we use .NET components in COM .NET comp...

How can we use .NET components in COM .NET components can't be used in straight forward way with the COM. You will require to create CCW in order to communicate COM components

Task on data mining, Task on data mining Project Description: Task on...

Task on data mining Project Description: Task on Opinion Mining, Sentiment Analysis Skills required are C# Programming, Software Architecture, Data Mining

What is a datareader object, What is a DataReader object? The DataReade...

What is a DataReader object? The DataReader object helps in retrieving the data from a database in a forward-only, read-only mode. The base class for all the DataReader objects

What is a manifest, What is a Manifest?  An assembly manifest have all ...

What is a Manifest?  An assembly manifest have all the metadata needed to specify the assembly's version requirements and security identity, and all metadata required to define

Mailer - mail sender, mailer - mail sender Project Description: I wan...

mailer - mail sender Project Description: I want a mailer: -run on Windows Server 2008 -use how many theard i need -more details speak on private Skills required

Explain ado.net in brief, Explain ADO.NET in brief. ADO.NET is a very s...

Explain ADO.NET in brief. ADO.NET is a very significant feature of .NET Framework, which is used to work with data that is stored in structured data sources, like databases and

Case statement, Design the following interface and add code to the command ...

Design the following interface and add code to the command buttons to achieve the following using case statement. I) find coursework to be calculated using the following formula:-0

How do i force the dispose method to be called automatically, How do I forc...

How do I force the Dispose method to be called automatically, as clients can forget to call Dispose method? To Call the Dispose method in the Finalize method and in the Dispose

What benefits have web services over component object model, What advantage...

What advantages have Web services over Component Object Model (COM) and Distributed Component Object Model (DCOM)? The benefits of Web services over COM and DCOM are as follow

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