programming-examples/c-sharp/_Basic/C# Program to Perform Unboxing Operation.cs

29 lines
515 B
C#
Raw Normal View History

2019-11-15 12:59:38 +01:00
/*
* 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