Lab 11 Class
Most of the Lab11 class is provided to you. To complete its definition, you will need to do the following:
- Create an ArrayList of CatalogItems named iPod.
- If you haven't declared and initialized an ArrayList before, this is how an ArrayList of Strings would look:
List<String> stringList = new ArrayList<String>()
; - Since we are making an iPod catalog, the type parameters for CatalogItem should be Integer and CD, respectively.
- Create an ArrayList of CatalogItems named kindle.
- This will look very similar to the declaration and initialization of iPod, but the CatalogItem type parameters will now be String and Book.
- Refer to code for adding CatalogItems to the iPod ArrayList. You should be able to add a CatalogItem to your kindle ArrayList in one line of code as well, though it will be pretty lengthy.
- You will be reading four complete lines as Strings.