質問編集履歴
1
質問内容の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
-
以下のコード
|
5
|
+
以下のコードで「Comparator.comparing」となっている理由が知りたいです。
|
6
6
|
|
7
7
|
|
8
8
|
|
@@ -44,7 +44,7 @@
|
|
44
44
|
|
45
45
|
// TODO 自動生成されたメソッド・スタブ
|
46
46
|
|
47
|
-
Set<Employee> set = new TreeSet<>(
|
47
|
+
Set<Employee> set = new TreeSet<>(Comparator.comparing(Employee::getId));
|
48
48
|
|
49
49
|
set.add(new Employee(3,"John"));
|
50
50
|
|