質問するログイン新規登録

回答編集履歴

1

追記

2017/07/13 11:22

投稿

root_jp
root_jp

スコア4666

answer CHANGED
@@ -2,4 +2,13 @@
2
2
  List<Info> sortedList = infoList.stream()
3
3
  .sorted(Comparator.comparing(info -> info.getSection().getSectionName()))
4
4
  .collect(Collectors.toList());
5
+ ```
6
+ ###追記
7
+ ```Java
8
+ Comparator<Info> comparator = Comparator.<Info, String> comparing(info -> info.getSection().getSectionName())
9
+ .thenComparing(info -> info.getSection().getSectionCode());
10
+
11
+ List<Info> sortedList = infoList.stream()
12
+ .sorted(comparator)
13
+ .collect(Collectors.toList());
5
14
  ```