我是 Java 新手
可以说我有
class OnlyNotes {
String notes;
}
和
List<OnlyNotes>;
如何将其转换为:
List<String>
包含笔记列表
你可以这样写。
List<OnlyNotes> onlyNotes = new ArrayList<>();
List<String> newStrings = onlyNotes.stream.map(e -> e.notes).collect(Collectors.toList());
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句