关于java:关于java8-对象转map时重复key-Duplicate-key-xxxx问题

57次阅读

共计 177 个字符,预计需要花费 1 分钟才能阅读完成。

反复时采纳前面的 value 笼罩后面的 value

Map<String, String> map = list.stream().collect(Collectors.toMap(Student :: getClassName, Student :: getStudentName,
(value1, value2)->{return value2;}));

正文完
 0