关于java8 对象转map时重复key Duplicate key xxxx问题
文章目录
重复时采用后面的value 覆盖前面的value
Map<String, String> map = list.stream().collect(Collectors.toMap(Student :: getClassName, Student :: getStudentName,
(value1, value2 )->{
return value2;
}));
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论