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


Custom Search

C# Source Code » Data Types » Boxing Unboxing »

 

explicit unboxing of an object to an int








    
 

using System;

class MainClass {

    public static void Main() {
        object myObject = 3;
        int myInt3 = (int)myObject;  // myObject is unboxed
        Console.WriteLine("myInt3 = " + myInt3);


    }

}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Data Types
» Boxing Unboxing