Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
如果您的目的是将一种类型的列表转换为另一种类型,则需要添加流式处理,
collector.tocollection
并修复某些通用类型,以便“列表”和“ clazz”与通用匹配参数:例如,以下将字符串列表转换为其各自长度的另一个列表:
If your intention is to convert a list of one type to another, you need to add stream handling,
Collectors.toCollection
and fix some of the generic types so that "list" and "clazz" match the generic parameters:For example, the following converts a list of strings into another list of their respective lengths: