using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _07匿名函数和lamda表达式语法 { public delegate void DelTest1(); public delegate string DelTest2(); public delegate string DelTest3(str…
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { delegate void DelegateGreet(string name); //声明委托类型 class Lamda { public static void EnglishGreet(strin…
JAVA9都要出来了,JAVA8新特性都没搞清楚,是不是有点掉队哦~ Lamda表达式,读作λ表达式,它实质属于函数式编程的概念,要理解函数式编程的产生目的,就要先理解匿名内部类. 先来看看传统的匿名内部类调用方式: interface MyInterface{ void lMethod(); } public class Main { public static void test(MyInterface myInterface){ myInterface.lMethod(); } publi…