Sunday, 26 May 2013

C# Programs of Boxing Unboxing


using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

 

namespace boxingunboxing

{

    class Program

    {

        static void Main(string[] args)

        {

            int a, b;

            double c;

            object o;

 

            a = 10;

            o = a;  //boxing

 

            b = (int)o; //unboxing

            c = (double)b;

 

        }

    }

}

No comments:

Post a Comment