File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
docs/java/What's New in JDK8 Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -442,15 +442,15 @@ optional.ifPresent((s) -> System.out.println(s.charAt(0))); // "b"
442442首先看看Stream是怎么用,首先创建实例代码的用到的数据List:
443443
444444```java
445- List<String > stringCollection = new ArrayList<> ();
446- stringCollection .add ("ddd2 ");
447- stringCollection .add ("aaa2 ");
448- stringCollection .add ("bbb1 ");
449- stringCollection .add ("aaa1 ");
450- stringCollection .add ("bbb3 ");
451- stringCollection .add ("ccc ");
452- stringCollection .add ("bbb2 ");
453- stringCollection .add ("ddd1 ");
445+ List<String > stringList = new ArrayList<> ();
446+ stringList .add ("ddd2 ");
447+ stringList .add ("aaa2 ");
448+ stringList .add ("bbb1 ");
449+ stringList .add ("aaa1 ");
450+ stringList .add ("bbb3 ");
451+ stringList .add ("ccc ");
452+ stringList .add ("bbb2 ");
453+ stringList .add ("ddd1 ");
454454```
455455
456456Java 8扩展了集合类,可以通过 Collection.stream () 或者 Collection.parallelStream () 来创建一个Stream。下面几节将详细解释常用的Stream操作:
You can’t perform that action at this time.
0 commit comments