explicit boxing of an int to an object : Boxing Unboxing : Data Types C# Source Code


Custom Search

C# Source Code » Data Types » Boxing Unboxing »

 

explicit boxing of an int to an object








    
 
using System;

class MainClass {

    public static void Main() {
        int myInt2 = 10;
        object myObject = myInt2;  // myInt2 is boxed
        Console.WriteLine("myInt2 = " + myInt2);
        Console.WriteLine("myObject = " + myObject);


    }

}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Data Types
» Boxing Unboxing