7/13 code executes, but assignment fails?


#1




code runs and does what I want, but still it doesn't give me a pass


import java.util.ArrayList;

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

		ArrayList<Integer> weeklyTemperatures = new ArrayList<Integer>();
		weeklyTemperatures.add(78);
		weeklyTemperatures.add(67);
		weeklyTemperatures.add(89);
		weeklyTemperatures.add(94);
		weeklyTemperatures.add(2, 111);

		for (int j = 0; j < weeklyTemperatures.size(); j++ ) {
   System.out.println( weeklyTemperatures.get(j) );
    }

	}
}


#2

Upon looking at this, I do not see anything wrong, however... Make sure your spelling and data input for everything is correct, and make sure it follows the requested method, and succeeds in the requested result.


#3

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