I don't see the problem with this code. 
<img src="//codecademy-discourse.s3.amazonaws.com/original/5X/d/c/e/7/dce7c1a93be8598158d29238add69303243a6234.PNG" width="343" height="500">



I don't see the problem with this code.


Don't you need a / at the end of your tag?

<img src="" />


you forgot the <> after the "new" command.
ArrayList<> is a generic collections class, so you have to specify what kind of data it will hold. by declaring the datatype between the diamonds.


I have egual problem, but is write correct
ArrayListsports=new ArrayList();
test run good but come this message:
Did you create an ArrayList named sports?


have a bug, but the sintax is correct.


ArrayListsports=new ArrayList();


the correct syntax is
ArrayList<Integer> arrayName = new ArrayList<Integer>();

Integer can be swapped with any data type you want to store in this ArrayList.

but with the new Java 8 you can use
ArrayList<Integer> arrayName = new ArrayList<>(); < you can leave out the 2nd explicit declaration.
but that doesn't work with Codecademy's version of Java.


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