更新时间:

#Java8_Function和BiFunction

#Function

  1. Function 接受一个参数,返回一个结果; 有apply compose anThen方法

  2. BiFunction 接受2个参数, apply anthen 方法

  3. Function作为一个函数式接口,主要方法apply接收一个参数,返回一个值

@FunctionalInterface  
public interface Function<T, R> {  
    /**  
     * Applies this function to the given argument.  
     *  
     * @param t the function argument  
     * @return the function result  
     */  
    R apply(T t);  
}​  
  1. 原文链接: https://www.jianshu.com/p/8dc46a2dc21d