摘要: Person result1 = collection.stream() // 转化为流 .filter(x -> "张三".equals(x.getName())) // 只过滤出"张三" .findAny() // 如果找到了就返回 .orElse(null); public class Dem 阅读全文
posted @ 2022-04-11 17:04 十三‘ 阅读(250) 评论(0) 推荐(0) 编辑