Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Lists Java Lists Java Lists Quiz

Unsure what the quiz question is asking of me, any help appreciated

I'm doing the beginner Java track and have found myself stuck for the second time.

First question is asking to declare a list of rocks with most of the code already written.

So I started with

List<String> rocks = new ArrayList<>();

I've re-watched the video several times now and this exact syntax is used as far as I can tell with groceryLine instead of rocks. But it wont accept it here. I don't know what the question is looking for.

2 Answers

Steven Parker
Steven Parker
231,271 Points

The instructions say to "Fill in the blank to declare the rocks variable as a List that contains Rock‍s", but this code creates a list that contains String‍s instead.

Note that "Rock" is an object class defined later in that same code.

Steven Parker
Steven Parker
231,271 Points

Sounds like you nearly had it; but the name of the object class is "Rock", singular, and with a capital "R".

All the documentation I can find online and video all use some form of list<String> example =

I'm just more confused than before sorry.

Out of curiosity I tried List<Rocks> or list<rock> or list<object> but none of that works, but i figured that much.