Unboxing object to in - CSharp Custom Type

CSharp examples for Custom Type:Box Unbox

Description

Unboxing object to in

Demo Code

using System;//from   w w w  .j  a  va  2  s.  c om
class TestUnboxing
{
   public static void Main()
   {
      int myInt = 3422;
      int yourInt;
      object obj = myInt;
      yourInt = (int)obj;
      Console.WriteLine("Value of yourInt: {0}", yourInt);
   }
}

Result


Related Tutorials