【发布时间】:2021-11-19 06:54:14
【问题描述】:
我是 Java 新手,在阅读这些特定的代码行时卡住了:
private static void checkPrice(final List<String> prices) {
List<String> inputCountryCodes = IntStream.range(0, prices.size())
.filter(index -> (index % 2 == 0))
.mapToObj(prices::get)
.collect(Collectors.toList());
List<String> distinctInputCountryCodes = inputCountryCodes.stream()
.distinct()
.collect(Collectors.toList());
}
谁能解释一下上面代码的para1和para2这些特定的代码行在这里做什么?
【问题讨论】:
标签: java list dictionary