📌 📄 内容摘要:
@bdmnovo 在 steam流toList和 collect(Collectors.toList())区别 中发帖
使用idea的时候 总是提示给 collect(Collectors.toList()) 转化成toList()格式,以为是性能优化,
[image]
结果后续报错UnsupportedOperationException。 后续了解到 collect(Collectors.toList())转化的是一个可变集合,而toList是一个不可变集合,也就意味着后续不能再添加元素了,又是小细节的一个小帖子。
────────── 链接信息 ──────────
🔗 论坛链接: linux.do
📎 访问地址: https://linux.do/t/topic/979225/1
─────────────────────────────
📢 来源:LINUX DO