13/13


#1



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">


#2


#3

I don't see the problem with this code.


#4

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

<img src="" />


#5

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.


#6

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

Why?

have a bug, but the sintax is correct.


#7

correct
ArrayListsports=new ArrayList();


#8

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.


#9

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