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&lt;WeatherSource&gt;


实际上是

List<WeatherSource>


参见HTML escape characters

07-26 04:25