File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
src/main/java/com/xu/java8/Stream Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -9,4 +9,7 @@ Java8 Learning (java8学习) <br>
9
9
10
10
├── com.xu.java8.lambda // Lambda表达式
11
11
├── com.xu.java8.Optional // java8-Optional类
12
- ├── com.xu.java8.Stream // java8-Stream接口
12
+ ├── com.xu.java8.Stream // java8-Stream接口
13
+
14
+ - java8-Optional类
15
+ [ Optional类的一些基本用法] ( https://github.com/MyHerux/java-java8-learning/blob/master/src/main/java/com/xu/java8/Optional/Optional.md )
Original file line number Diff line number Diff line change @@ -65,8 +65,8 @@ public static void main(String args[]) {
65
65
.filter (x -> JSONObject .fromObject (x ).containsKey ("type" ))
66
66
.map (x -> JSONObject .fromObject (x ).getString ("type" ))
67
67
.forEach (x -> {
68
- if (type_count .containsKey (x )) type_count .put (x . toString () , type_count .get (x ) + 1 );
69
- else type_count .put (x . toString () , 1 );
68
+ if (type_count .containsKey (x )) type_count .put (x , type_count .get (x ) + 1 );
69
+ else type_count .put (x , 1 );
70
70
});
71
71
System .out .println (type_count .toString ());
72
72
}
You can’t perform that action at this time.
0 commit comments