Java核心技术_笔记6-7

1 . repeat(10 , 0 - > System.out.println(" Hello , World ! ")); 要接受此lambda表达式,需要提供函数式接口 public static void repeat ( int n , Runnable action) { for ( int i = 0;i < n;i ++) action.run() ; } action.run()
相关文章
相关标签/搜索