我正在尝试将String ArrayList转换为Double List。当我去声明重复列表时,会引发错误。
ArrayList<String> domainList = new ArrayList<String>();
List<Double> domainNumList = new ArrayList<Double>();
domainNumList = domainList.stream().map(Double::valueOf).collect(Collectors.toList());
我希望domainNumList充满domainList的Double值。但是会抛出错误“ error: type List does not take parameters
List<Double> domainNumList = new ArrayList<Double>();
”。我该怎么办?