I benn trying to fix this block.There is no error in there I guess but it deosnt allow me to go on... please help me out!


#1

import java.util.ArrayList;

public class TemperaturesForEach {
public static void main(String[] args) {

	ArrayList<Integer> weeklyTemperatures = new ArrayList<Integer>();
	weeklyTemperatures.add(78);
	weeklyTemperatures.add(67);
	weeklyTemperatures.add(89); 
	weeklyTemperatures.add(94);
	
	for (Integer temperature : 
     weeklyTemperature) {
		System.out.println(temperature);
	}

}

}


#2

you forget the s of weeklyTemperature


#3

MMmmh so close. That variable does actually represent one temperature, it should not have an s. But weeklyTemperature isn't defined.


#4

yeah it's a mistake, i've corrected it. :+1:


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.