这&的目的是什么?在这种背景下的符号?

时间:2017-06-04 08:00:59

标签: java

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();
    }
}

我搜索了& amp;符号在这里意味着但我找不到它的任何意义?! 你能告诉我们这行是怎么回事吗?

private List<WeatherSource>weatherSources;

1 个答案:

答案 0 :(得分:4)

这只是<>的HTML源代码编码。以下内容:

List&lt;WeatherSource&gt;

实际上是

List<WeatherSource>

请参阅此处查看HTML escape characters