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

16 lines
357 B
C#
Raw Normal View History

2019-11-15 12:59:38 +01:00
/*
* C# Program to Illustrate Predicate
*/
using System;
class Program
{
static void Main()
{
Predicate<int> predicate = checkval => checkval == 6;
Console.WriteLine(predicate.Invoke(4));
Console.WriteLine(predicate.Invoke(5));
Console.WriteLine(predicate.Invoke(6));
Console.Read();
}
}