这个错误提示是因为使用了Java 8以下的版本,导致List接口中没有of方法。可以将List.of改为Arrays.asList来解决该问题,如下所示:

this.tradeDayList = Arrays.asList(tradeDayList.stream() .map(dateStr -> LocalDate.parse(dateStr, DateTimeFormatter.BASIC_ISO_DATE)) .sorted() .toArray(LocalDate[]::new));

可以使用Java8的LocalDateTime和LocalDate来处理日期时间import javatimeLocalDate;import javatimeLocalDateTime;import javatimeLocalTime;import javatimeformatDateTimeFormatter;import javatimetemporalChronoUnit;import j

原文地址: https://www.cveoy.top/t/topic/ffua 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录