lambda expressions and anonymous inner classes and double colons (: :)

lambda表达式Can refer to other methods or constructor and only one code is automatically called Shihai can omit the parameter passing, code more compact, requires the use of a reference method syntax ::notation. lambda表达式It offers four ways reference methods and constructors:

  • The method of the referenced object 类::实例方法
  • Referenced class method 类::类方法
  • Method references a specific object 特定对象::实例方法
  • Reference class's constructor 类::new

 1111 

Guess you like

Origin www.cnblogs.com/heqiyoujing/p/11361405.html