programming-examples/c-sharp/Events/C# Program to Illustrate Actions.cs

16 lines
381 B
C#
Raw Normal View History

2019-11-15 12:59:38 +01:00
/*
* C# Program to Illustrate Actions
*/
using System;
class Program
{
static void Main()
{
Action<int> action1 =(int x) => Console.WriteLine("OUTPUT {0}", x);
Action<int, int> action2 =(x, y) => Console.WriteLine("OUTPUT {0} and {1}", x, y);
action1.Invoke(1111);
action2.Invoke(200, 3000);
Console.Read();
}
}