Data-Structures 3/13 error?


My task should be to insert an ArrayList into the main method. Every time I try to run it, it tells me, I hadnt created an object, called “weeklyTemperatures”, yet I did.
I tried restarting it, I tried copying the code and going back a few steps, going forward again and copypaste the code again… it just wont work…

Thanks for your help :slight_smile:

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>


import java.util.ArrayList;

public class For {
public static void main(String args) {
ArrayList weeklyTemperatures = new ArrayList ();



<do not remove the three backticks above>

Hi but the class name should be

public class Temperatures { 
   #here put your main method

Hey, just to add onto what @wizmarco said…

It looks like having a space between

new ArrayList



may be causing the problem here. Try removing that space and with any luck it should pass.

Note: In any other environment that space wouldn’t have been an issue, but because of the nature of Codecademy’s environment sometimes these kind of pedantic issues will come up.

1 Like

Thx so much for your help! I tried it but somehow it still didnt work. I solved it now: using another browser did the trick :wink:

1 Like

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