You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
614 B

3 years ago
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Delegate
{
class InterA
{
private delegate void RunDelegate(int i);
private void PrintDec(int val)
{
Console.WriteLine("{0}", val);
}
private void PrintHex(int val)
{
Console.WriteLine("0x{0:X}", val);
}
public void DoWork()
{
RunDelegate run = new RunDelegate(PrintDec);
run(1024);
run = PrintHex;
run(1024);
}
}
}