java8 stream 用法收集
作者:互联网
public class Test1 { public static void main(String[] args) { List<Integer> numbers = new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9)); C1 c1 = new C1(); numbers.parallelStream().forEach(c1::method1);//操作元素 } static class C1 { public void method1(Integer integer) { System.out.print(integer + "\t"); } } }
标签:stream,method1,java8,static,numbers,new,C1,用法,public 来源: https://www.cnblogs.com/hahajava/p/11322137.html