#ArrayList basics

1 messages · Page 1 of 1 (latest)

meager idol
#

Instead of "Book" here should'nt it say "String"?

viscid umbraBOT
#

<@&987246399047479336> please have a look, thanks.

quartz vault
#

List of Book objects. Where's the Book.java file.

meager idol
#

this is book class

#
ArrayList<String> books;
#

i still dont understand

quartz vault
#

Library holds Books, not strings.

#

Was there an assignment you're trying to do?

#

The Book class doesn't actually use ArrayList so that import is doing nothing.

bold cedar
#

You should use the interface on the left hand side, not the implementation.
What's between <> indicates what can be stored in the list.

zinc mountain
#

ArrayList is a parameterized type. Meaning the object/class will use whatever is inside <> in some way. In the case of arraylist it means that the arraylist is a list of Book objects. Does it make sense?

wheat dew
#

J