Today we started talking about Abstract Data Types and how there is the abstract definition and the actual concrete implementation. You're going to write the implementation for the List ADT. A List is like an array, except that grows to accomodate data that are added to it. There is an add() method that appends data to the end of the list, and this can be called without limit. Because the class is not a true array, you must use methods like get(int) to access the list, instead of array notation like a[int].
Read Section 9.2 - List ADT in DSA. Section 9.3 is also helpful as it discusses implementation, but it is optional as it will differ slightly from our APCS List implementation below so you'll still need to think carefully when writing your own if you read that section!
Download the ArrayList lab zip file. Complete the class called ArrayList so that implements the AP List interface using an array as its means of storage. You must implement all of the required methods of the interface except iterator() and listIterator() (you may just return null for those methods). You are also welcome to write additional private helper methods if you wish. Complete the required methods by the start of next class (the final complete version will be due Tuesday, but we'll start with this).
Hint: we're working with generics, but Java does not allow the direct creation of arrays with a generic type. To make a generic array, you should create an Object array and then cast it to the generic array type, like this:
@SuppressWarnings("unchecked") E[] newArray = (E[])new Object[10];