java8学习
文章目录
1、Function函数
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);
}
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册⭐️ Admin快速开发: https://show.cool-admin.com/
赞 0⭐️ 官方文档: https://cool-js.com
赞 0⭐️ chatgpt在线体验: https://cool-js.com/ai/chat-vip/index.html?r=helloworld
赞 0