ArrayList<Object> objects = new ArrayList<>();
for (int j = 0; j < 100; j++) {
objects.add(j);
}
for (Object object : objects) {
System.out.print(object);
}
objects.forEach(e->{
System.out.print(e);
});
objects.parallelStream().forEach(e->{
System.out.print(e);
});
java8新特性-foreach&lambda
最新推荐文章于 2023-09-12 17:07:12 发布