public class WeatherAggregator {
private List<WeatherSource> weatherSources;
public WeatherAggregator(List<WeatherSource> weatherSources) {
this.weatherSources = weatherSources;
}
public double getTemperature() {
return weatherSources
.stream()
.mapToDouble(WeatherSource::getTemperatureCelcius)
.average()
.getAsDouble();
}
}
我搜索了这里的 & 符号是什么意思,但我找不到它的任何含义?! 你能说出这一行发生了什么吗?
private List<WeatherSource>weatherSources;
最佳答案
这只是 <
的 HTML 源编码和>
。以下内容:
List<WeatherSource>
实际上是
List<WeatherSource>
请参阅此处的 HTML escape characters
关于java - 在这种情况下这个 & 符号的目的是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44351986/