Объяснить строку кода - C# (194657)
Формулировка задачи:
Объясните строку кода.
Func<string, List<Car>, Car> Find = (string str1, List<Car> cars) =>
{
return cars.Find(x => x.Name == str1);
};Решение задачи: «Объяснить строку кода»
textual
Листинг программы
using System;
namespace Delegates
{
public delegate void MyDelegate();
class Program
{
static void Main()
{
MyDelegate myDelegate;
myDelegate = delegate { Console.WriteLine("Hello 1"); }; // Лямбда-Метод
myDelegate += () => { Console.WriteLine("Hello 2"); }; // Лямбда-Оператор.
myDelegate += () => Console.WriteLine("Hello 3"); // Лямбда-Выражение.
myDelegate();
}
}
}