java8學習

一、Function函數app

public static void main(String[] args) {
      TestController t = new TestController();
      new TestController().aaa(3,value -> t.bbb(value));
}

public int bbb(int b){
        return b+100;
}

public void aaa(int a,Function<Integer,Integer> f){
      Object apply = f.apply(a);
      System.out.println("ggg:"+apply);
}
相關文章
相關標籤/搜索