简体   繁体   中英

what is the purpose of this & symbol in this context?

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

I searched about what does the & symbol here mean but I could not find any meaning to it ?! can you tell what is going on in this line ?

private List<WeatherSource>weatherSources;

It is just HTML source encoding of the < and > . The following:

List&lt;WeatherSource&gt;

is actually

List<WeatherSource>

See here for the HTML escape characters

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM