Collections.max(arraylist)doesn't work, and the regular loop fordoesn't work either.
I have:
ArrayList<Forecast> forecasts = current.getForecasts();
Collections.max(forecast) gives me this error:
The method max(Collection<? extends T>) in the type Collections is
not applicable for the arguments (ArrayList<Forecast>)
ArrayListcontains Forecastobjects, each of which has a field intfor the temperature of each day. I am trying to save max to int max.
source
share