Data-Structures 3/13 error?


#1



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:


https://www.codecademy.com/en/courses/learn-java/lessons/data-structures/exercises/arraylist?action=resume


import 	java.util.ArrayList;

public class For {
	public static void main(String[] args) {
		ArrayList<Integer> weeklyTemperatures = new ArrayList <Integer>();
			
	}

}


#2

Hi but the class name should be

public class Temperatures { 
   #here put your main method
}

#3

Hey, just to add onto what @wizmarco said..

It looks like having a space between

new ArrayList

and

<Integer>();

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.


#4

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:


#5

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