programming-examples/c-sharp/Basic/C# Program to Perform Unboxing Operation.cs
2019-11-18 14:44:36 +01:00

29 lines
515 B
C#

/*
* C# Program to Perform Unboxing Operation
*/
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();
}
}
/*
Data : 50
Data : 0