摘要: 1. 价格的格式化,三位带个逗号。注意DecimalFormat 类下的format方法需要接受一个数字类型,folat或者double,所以price需要强转一下。然后该方法返回string。 否则会报错,Cannot format given Object as a Number错误 Decim 阅读全文
posted @ 2020-08-13 10:40 了悟 阅读(228) 评论(0) 推荐(0) 编辑
摘要: Person类 // 根据name去重 List<Person> uniquePersons = persons.stream().collect( Collectors.collectingAndThen( Collectors.toCollection(() -> new TreeSet<>(C 阅读全文
posted @ 2020-08-13 10:10 了悟 阅读(1396) 评论(0) 推荐(0) 编辑