Friday, 1 December 2017

C# Program to Perform Unboxing Operation


Code:

using System;
class sample
{
    int data;
    void insert(object x)
    {
        data = (int)x * 5;
    }
    object delete()
    {
        data=0;
        return (object)data;
    }
    public static void Main()
    {
        sample s = new sample();
        s.insert(10);
        Console.WriteLine("Data : {0}", s.data);
        Console.WriteLine("Data : {0}", s.delete());
        Console.ReadLine();
    }
}


Output:

Data : 50
Data : 0


More C# Programs:



















100+ Best Home Decoration Ideas For Christmas Day 2019 To Make Home Beautiful

Best gifts for Christmas Day | Greeting cards for Christmas Day | Gift your children a new gift on Christmas day This Christmas d...