5/13 even the right code isn't right


#1



https://www.codecademy.com/courses/learn-java/lessons/data-structures/exercises/arraylist-access?action=lesson_resume&link_content_target=interstitial_lesson


There are no errors in the console, and the correct value is printed. The code is not accepted, however, and instead I get the general error message "Did you print out the lowest temperature? Use the example to help you." Finally I gave up and clicked "Get Code", with the same result. Their code is given below. Can anyone help? Thanks!


import java.util.ArrayList;

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

    ArrayList<Integer> weeklyTemperatures = new ArrayList<Integer>();

    weeklyTemperatures.add(78);
    weeklyTemperatures.add(67);
    weeklyTemperatures.add(89);
    weeklyTemperatures.add(94);
    
    System.out.println( weeklyTemperatures.get(1) );
    
	}
}


#2

Oh, and also, the "report bug" link takes me back to the exercise page.


#3

Delete the one space between ( and weeklyTemperatures. If that doesn't work, reload the page or go back a lesson and then go back to this lesson. If it still doesn't work, just reset exercise and retry it.


#4

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